> <i>If I can't run asynchronous APIs in the frozen or terminated states, how can I save data to IndexedDB?<p>[In the future, we will add a commit() method to perform write-only transactions that don't require callbacks. (assuming the IndexedDB database is already open).]</i><p>This seems like a strange design. So there is a callback specifically for persisting data before freeze, but when it runs, the main persistance API isn't actually available.<p>Wouldn't it have been possible to mark IndexedDB callbacks as "non-freezable tasks" - or allow a promise to be returned from the freeze callback? (Subject to a timeout)<p>> <i>For code that needs to work today, however, developers have two options:<p>- Use Session Storage [...]<p>- Use IndexedDB from your service worker [...]</i><p>I guess session storage is technically a workaround - but it seems odd, as almost everywhere else you get the recommendation to use IndexedDB instead.<p>I guess a strategy could be to simply dump all your unsaved data into session storage on freeze, and then "properly" load it into IndexedDB on the next load or unfreeze. Still, this seems complicated and subject to problems if your data exceeds the maximum storage size.