Summary
Our merchants operate in environments with highly volatile internet connectivity. Currently, if a merchant attempts to finalize a transaction while the network drops, the POST request fails and the data is lost. This results in unacceptable friction at the point of sale and requires the merchant to manually restart the flow.
We must transition the PWA to a strict offline-first architecture. All outgoing API requests should be intercepted and queued locally using IndexedDB (idb). A background synchronization manager must be implemented to monitor the navigator.onLine status and automatically flush the queue to the backend when connectivity is restored, ensuring absolute data integrity.
Acceptance Criteria
Tech Stack
Next.js 14, React, IndexedDB, Service Workers.
Summary
Our merchants operate in environments with highly volatile internet connectivity. Currently, if a merchant attempts to finalize a transaction while the network drops, the POST request fails and the data is lost. This results in unacceptable friction at the point of sale and requires the merchant to manually restart the flow.
We must transition the PWA to a strict offline-first architecture. All outgoing API requests should be intercepted and queued locally using IndexedDB (
idb). A background synchronization manager must be implemented to monitor thenavigator.onLinestatus and automatically flush the queue to the backend when connectivity is restored, ensuring absolute data integrity.Acceptance Criteria
idbto manage a local, persistent transaction queue.Tech Stack
Next.js 14, React, IndexedDB, Service Workers.