Skip to content

Changes to storage in emulator get lost on tab reload / browser crash #302

Open
@ticalc-travis

Description

@ticalc-travis

I use the IDE with Chromium on Ubuntu (whichever version that is, but it should be reasonably up to date) and on two computers regularly have issues with the storage in the emulated Bangle getting reverted to its state days or even weeks earlier whenever I close the emulator window, disconnect from it, restart the browser, or have it crash. Only rarely does it seem to actually save the changes made in a working session, apparently at random.

I suspect an issue with the emulator flash not getting saved back to browser localStorage when it should. Looking at the code, it only seems to happen with window.onUnload, and apparently I guess this doesn't work reliably in Chromium. Probably better to also save it back every X minutes, or say, a few seconds after the last change to emulated storage was made.

Edit: For what it's worth, Chromium does give a warning that onUnload is deprecated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions