Review request

Attendance PWA loses a whole morning of data on school iPads

Solved · 16 views · asked by rosa_m · edited

Repo or live app

attend.rosa-martin.dev

Unsure about: Other

Teachers mark attendance on iPads in rooms with no wifi, and it syncs when they are back in range. v0 built the offline part with localStorage and a sync on reconnect. Twice now a teacher has come back and the morning was simply gone. Both times on an iPad that had not been used for over a week.

Comment

2 answers

Marked as helpful by the asker
ben_mobile · edited

"Not used for over a week" is the whole answer. Safari clears script-writable storage, localStorage and IndexedDB both, after seven days without user interaction with the site. It is a privacy feature and it will keep eating your mornings.

The documented exemption is sites added to the home screen. Get the iPads to install it: valid manifest with display: standalone, then Share and Add to Home Screen. Installed web apps keep their storage.

While you are there, move off localStorage anyway. It is synchronous and capped around 5 MB, and a half-written JSON blob on a backgrounded tab is its own failure mode. IndexedDB with a small wrapper is the right store for a queue of pending records, and you get transactions.

Comment
dev_ana · edited

Add one visible thing for the teachers: a count of unsynced records in the header, and a warning if it is older than a day. Silent offline queues fail silently. A number on screen turns a lost morning into someone saying "it still says 28 pending" before it matters.

Comment