Street 05 › Devlog › Safari forgets after 7 days: keeping players' progress on iPhone
Safari forgets after 7 days: keeping players' progress on iPhone
The Skill Lab saves progress in the browser: streaks, scores, medals, full-game campaigns. No account needed, nothing uploaded. On an iPhone that has a catch.
The 7-day rule
Safari deletes everything a website stored after 7 days of using Safari without visiting it, unless the site is on the home screen. For a game, that's the worst kind of bug: someone takes a week off and comes back to nothing. People don't return to a place that forgot them.
There's a second catch. On iPhone, a site added to the home screen gets its own storage, separate from Safari's. Installing it doesn't bring the Safari progress along.
What we built
- A home-screen app that works. Real PNG icons (iPhones ignore SVG ones), opening straight into the Skill Lab.
- Asking to keep the data. After a player's first finished day, the site asks the browser, once and with no popup, to keep its storage. Chrome usually agrees; Safari decides for itself.
- Backup and restore. One file with the player's progress, saved to the phone. Restoring merges with what's already there by the same rules our cloud sync uses, so an old backup can never wipe newer progress. Files are checked before use, and anything malformed or tampered with is refused.
- One card, at the right time. Only once there's something to lose (10 rounds or a 3-day streak), and only if nothing protects it yet. Worded for the device: on iPhone, save a backup, add to the home screen, then restore in the app.
What a real phone taught us
We tested everything in Safari's engine on Windows, and it passed. Then it went to a real iPhone, and two things were wrong.
The card never appeared. It lived on the Skill Lab tab, and most people reach the games from somewhere else. The fix put it at the top of the arcade on every tab, plus one line on the end-of-round screen, which every player passes through.
"Save a backup" dropped a raw .json file into Downloads, with no explanation. On phones it now opens the share sheet (Save to Files, AirDrop, email), says where the file went and how to use it, and the file starts with a plain note explaining what it is.
Both were obvious in hindsight, and neither would have been caught by an automated test, because the code was doing exactly what we'd written.
What we'd tell another team
- If your web game keeps progress in the browser, plan for Safari's 7-day rule from the start.
- Merge on restore; never overwrite.
- Put the thing you need people to see where they already are, not where it logically belongs.
- Test with a person and a real phone. It found two problems in five minutes.