You can’t trust localStorage anyways - it will silently drop some writes in Chrome and Firefox. Some years ago, we used localStorage for queuing writes to the backend and found that concurrent access to localStorage caused data loss - some transactions never came back out of localStorage. One of our engineers wrote a stress test and confirmed the issue. We switched to IndexedDB after that.