
Summary
Key points of this document
- Where are the design challenges?
- How to define boundaries
- Details that matter in implementation
Overview
Handling offline input in PWAs improves user experience. However, if it's not clear whether data has been sent or not, or if it conflicts with the server, data reliability decreases. The difficulty of offline input isn't just about being able to save, but about being able to explain to the user what is considered correct when data is synchronized later.
Where are the design challenges?
In forms that allow offline input, there's a risk of duplicate submissions of the same content or overwriting with old data when communication is restored. Simply saving locally is not enough.
Browser local storage is device-dependent and has limitations in persistence and capacity. Care must be taken when storing personal or confidential information for extended periods. Explanations to users are also necessary when synchronization fails.
Creating offline forms with PWA allows input even without a network connection. However, during synchronization, server-side changes, duplicate entries, validation changes, and partial failures can occur. A simple retry queue cannot fully account for these.
How to define boundaries
Form states are divided into draft, pending submission, submitting, submitted, and failed. A client-generated ID is passed to the server so that resubmissions are treated as the same registration.
In the design, local drafts and server-confirmed data are separated. User input is first saved to IndexedDB and then sent as a synchronization queue after connection is restored. Server responses trigger state transitions to synchronized, conflicted, or awaiting correction.
Details that matter in implementation
On the React side, we save the minimum necessary input content and state to IndexedDB. When online, pending submissions are processed sequentially, and on success, the server ID is recorded. On failure, the reason and a retry button are displayed.
On the React side, we separate form state, persistence state, and sync state. IndexedDB stores localid, serverid, payload, schemaversion, lastmodifiedat, syncstatus, and allows synchronization processing to be executed both in the background and manually.
- Do not use the same completion display for successful local saving and successful server registration.
- Decide how to migrate or discard old drafts when the schema changes.
- Allow users to choose between retrying, editing, or discarding on synchronization failure.
Observe how it breaks
During verification, we check for going offline mid-input, disconnection during submission, resubmission after recovery, duplicate submission of the same draft, and conflicts with server-side modified data. We also check if the state persists even after closing the browser.
During verification, we check for going offline mid-input, disconnection immediately after submission, multiple tabs, old drafts, and server-side conflicts. We use Playwright to switch network states and ensure that the status display does not cause misunderstandings.
Discarded options and tradeoffs
The more extensive the offline support, the more complex state management becomes. One approach is to start with only draft saving and limit automatic synchronization to high-priority forms. A different design is required if aiming for fully offline operations.
Deepening offline support strengthens UX, but increases the complexity of conflict resolution and data migration. It's important to decide not to make all functions offline, but to narrow down to only the inputs truly necessary on-site.
Decision criteria to retain on-site
PWA offline input is not a saving feature, but a synchronization design. By clearly defining state, idempotency, and conflicts, forms can withstand temporary communication instability.
In PWA offline forms, state design is more important than saving processes. If users can understand how much of their input is confirmed, they can use the forms with confidence even in unstable network environments.


