Hacker News new | ask | show | jobs
by augusteo 138 days ago
Curious about the failure modes here. What specifically causes the silent data loss?

The "serialize to localStorage on blur" approach onion2k mentions seems like it would catch most cases. But I've definitely lost form data in ways I couldn't explain. Mobile Safari is particularly bad about this.

1 comments

A common cause is multi-page forms that silently push URL changes to your browser history stack, and also set headers that block pages being cached by the browser properly. On mobile that means an accidental swipe up takes you 'back' a page, which reloads the form losing all the data.

The web dev who built it needs to have made a few errors at the same time, but browsers, HTTP servers, and JS all work in tandem to make foot-guns like that very easy to pull off.