Offline first app: 8 decisions for work that survives a lost connection
An offline first app supports selected useful work through local data and a planned synchronization process, so a weak or missing connection does not stop every action. For a field team, that can mean reading an assigned job, recording notes, or capturing an inspection before reconnecting.
The difficult part is preserving truthful state. Saving a form on a device does not mean the server accepted it. A locally edited stock count may conflict with another user’s update. Therefore, the app must distinguish local progress, pending work, accepted changes, and unresolved conflicts.
This guide explains eight decisions for an offline first app: workflow scope, local data, queued writes, conflict handling, synchronization, user feedback, security, and testing. It focuses on business reliability rather than assuming that adding a cache makes every feature work offline.
1. Choose exactly what can happen offline
List the actions users need when connectivity disappears. Separate reading existing information from creating or changing records. A technician may need job instructions and note capture, while final pricing approval may still require a live server decision.
Define the boundary in business terms. Can the user create a draft order, or does the app promise confirmed stock allocation? Those are different commitments. A disconnected device cannot know every change made elsewhere.
Also decide which information must be available before the user leaves coverage. An app cannot display a document it never downloaded. Provide a clear preparation step for assigned jobs, maps, forms, or attachments where the workflow needs them.
Keep the initial scope narrow. One dependable offline inspection flow can be more useful than many screens that appear available but fail at an important final step.
2. Design a durable local data model
The app needs an appropriate local store for the records it must read or change. In a native mobile application, this may be a local database. In a web application, suitable browser storage can support structured data, subject to platform behavior and storage constraints.
Android’s offline-first architecture guidance describes local and network data sources, queued work, and synchronization choices. The general design lesson is to give the interface a consistent data path rather than scatter network-dependent reads across screens.
Model local state explicitly. A job can have a last synchronized version, local edits, and pending attachments. Keep those distinctions so the app does not mistake an incomplete upload for a completed business record.
For browser-based designs, our guide to IndexedDB explains storage-specific decisions. Local persistence is one component of the wider offline workflow, which also needs authorization, reconciliation, and recovery.
3. Queue changes with stable operation identity
When a user saves offline work, persist the change and the pending operation reliably. A value held only in screen memory can disappear when the app closes. The local data and queue design should support the interruptions the business expects.
Give each intended operation a stable identifier. If the app reconnects and loses the response, a later attempt should refer to the same action rather than create a second inspection or order.
Our guide to an idempotency key explains the server-side part of safe retries. The client must preserve identity, while the server must recognize repeats under its documented policy.
Also define ordering. A note attachment may depend on the inspection record existing first. A cancellation may supersede a pending edit. The queue should represent those relationships rather than assume every operation can run independently in any order.
4. Choose conflict rules from business meaning
A conflict occurs when local work no longer fits the server’s current state. Two staff members may edit the same inspection, or the office may cancel a job while a technician remains offline.
Do not apply “last write wins” to every case by default. It can be acceptable for some low-risk preferences, but it can also discard important work. Device clocks and delayed synchronization further complicate timestamp-based decisions.
Consider field-level merging, version checks, explicit rejection, or human review according to the data. Two independent notes may combine safely, while two different safety answers may require a person to resolve the discrepancy.
Preserve both the local contribution and enough server context to explain a conflict. A generic error that erases the user’s work creates avoidable re-entry and support effort. The interface should help the user understand which decision needs attention.
5. Make synchronization resumable and bounded
Offline data synchronization needs a strategy for both directions. The app may pull changed assignments and push pending work. Decide how it identifies progress, retrieves deletions, and avoids downloading the entire dataset after every reconnect.
Use bounded retries and sensible backoff. A connectivity indicator can report a network connection even when the application server remains unreachable. Treat actual request outcomes as part of the sync decision.
MDN’s guide to offline and background operation describes service workers and background synchronization in progressive web apps. Support and scheduling behavior vary, so verify the target browsers and provide a foreground recovery route.
Do not promise that synchronization always finishes after the user closes an app. Operating systems and browsers can restrict background work. Critical pending items should remain visible when the user returns, with a safe way to resume.
6. Show local, pending, and accepted states clearly
Use language that matches the actual commitment. “Saved on this device” means something different from “Received by the server” or “Approved.” Avoid showing one green tick for all three states.
Give users a practical view of pending work. Show which records still need upload, which failed validation, and which require conflict resolution. Where useful, display the last successful sync time and the age of locally available information.
Also provide a deliberate manual sync action when it helps. It should not create duplicate operations or conceal persistent errors. Explain what the user can do if a record remains unresolved.
Our guide to mobile app design evaluation highlights the value of testing complete user flows. For offline work, test the user’s understanding of status as carefully as the technical retry mechanism.
7. Protect data and access on the device
Offline capability creates local copies of business information. Limit downloads to the records users need, choose appropriate device protections, and define how long local data remains available.
Authentication can expire while a device is disconnected. Decide which existing local actions remain available, which require a new online check, and how the server validates queued changes after reconnecting. A previously authorized user may no longer have permission when the request reaches the server.
Plan logout and account switching carefully, especially on shared devices. One user’s pending work should not appear under another user’s account. Clearing local storage also needs care if it would erase unsynchronized records.
Coordinate these rules with mobile device management where the organization controls a device fleet. Remote removal cannot take effect on a disconnected device until the relevant management channel can reach it.
8. Test interruptions at the points that matter
Do more than turn the network off before opening the app. Interrupt a save, an attachment upload, a server response, and a synchronization batch. Then restart the app and inspect the resulting local and server records.
Test a weak connection, not only a clean offline state. Slow requests and repeated connection changes can reveal different problems from total loss of access. Include low storage, expired credentials, and an application update with pending work.
Use two devices to test conflicts. Have them edit the same assigned record while disconnected, then reconnect in different orders. Verify that the resolution follows the business policy rather than whichever timing happened during development.
Finally, ask a user to explain the status of each test record. If they cannot tell whether work is safe locally or accepted centrally, improve the interface before relying on it in the field.
An inspection workflow example
Suppose a field team performs equipment inspections in buildings with poor coverage. Before a visit, the app downloads assigned jobs and the relevant checklist version. It shows which assignments are ready for offline use.
The technician records answers and photographs. The app saves them locally and marks the inspection pending. Each submission and attachment has an appropriate stable identity so a reconnect can resume without blindly creating duplicates.
Meanwhile, the office changes an assignment. When the technician reconnects, the server checks the current version and permissions. If the new state conflicts with the submitted work, the system preserves the inspection and routes it for review instead of silently overwriting it.
After the server accepts the record and required attachments, the app shows the accepted state. A separate approval step remains distinct if the business process requires it. The user never has to infer completion from the disappearance of a spinner.
Plan storage and application updates
Large photographs can consume local space quickly. Set an appropriate attachment policy, monitor available capacity where supported, and handle failed local writes honestly. Do not report a successful save if the device could not persist the data.
Browser storage can face quotas or removal, depending on the platform and conditions. web.dev’s offline data guidance explains storage management considerations. Verify the actual environments your users depend on.
Application upgrades also need a local data migration plan. Test older pending records under the new version. A release should not make yesterday’s unsynchronized work unreadable or reinterpret its fields without a controlled rule.
When online-only behavior is appropriate
Some decisions require current shared facts, such as confirming scarce stock or approving a high-impact change. The app can still support offline preparation while reserving final commitment for an online check.
State that boundary clearly. A draft reservation request can be useful without pretending that the reservation already exists. This preserves productivity while keeping the business promise aligned with what the system can know.
Distinguish a local draft from a business reservation
Some field workflows involve resources that other people can consume while a device is disconnected. Stock, appointment slots, and shared equipment are common examples. A local draft can record the user’s request, but it cannot establish that the central resource remains available.
Define the confirmation step explicitly. When connectivity returns, the server checks current availability and either accepts the request or presents a meaningful alternative. Preserve the user’s entered information so a rejection does not force them to start again.
If the business needs preallocated offline rights, such as a bounded stock allocation for a route, design that as a separate controlled process. Track what the device may commit and how unused allocations return. This is a different promise from unrestricted offline access to a shared pool.
Test the explanation with field staff. They should know which actions create a firm commitment and which remain requests until the server confirms them.
Keep a clear support route for unresolved records. A technician should not need to delete local work as the first step in fixing a sync problem.
Frequently Asked Questions
Does caching make an app offline first?
Not by itself. The workflow also needs local state, pending operations, synchronization, conflict rules, and clear user feedback.
Should every conflict use the latest timestamp?
No. Choose a rule from the business meaning. Some changes can merge, while others need rejection or human review.
Can background sync guarantee delivery after the app closes?
No universal guarantee applies across platforms. Verify support and provide a visible, resumable path when the user returns.
Make disconnected work trustworthy
An offline first app should preserve useful work and explain its status through interruption and recovery. Oxen Softwares teams can begin with one field workflow, define its commitment boundaries, and test local storage, conflicts, and server acceptance together.