Offline form
Answer out loud or in your head first, then compare.
Answer
I save the draft locally, e.g. in IndexedDB, and show the user a clear state: “saved on this device, waiting to be sent”. A service worker can serve the app's saved resources without a network.
Once the connection is back, I try to send the form. On error I keep the draft and offer a retry. Background Sync can help, but it isn't available everywhere.
In practice: an operation ID and idempotency on the server protect against saving twice. I account for an expired session and data conflicts.
Pitfall: offline, you can't actually deliver data to an unreachable server. navigator.onLine is a hint, not proof that a particular API is responding.
How did it go? Be honest — “Not yet” puts the question on your review list.