Skip to content

localStorage values set when Atom is closing are not persisted #227

@probablycorey

Description

@probablycorey

I added the branch cj-test-for-zcbenz to demonstrate this problem.

If Atom is quit cmd-q values set to localStorage durring the beforeUnload event are not persisted. Here is the output from the cj-test-for-zcbenz branch when Atom is started, quit and then reopen.

[atom] atom -d -f
[9426:0409/110850:INFO:CONSOLE(56)] "-- start --", source: /Users/corey/github/atom/src/window-event-handler.coffee (56)
[9426:0409/110850:INFO:CONSOLE(58)] "am-i-set: null (expect this to be `null` the first time and `true` the second)", source: /Users/corey/github/atom/src/window-event-handler.coffee (58)
[9426:0409/110859:INFO:CONSOLE(60)] "-- beforeunload called --", source: /Users/corey/github/atom/src/window-event-handler.coffee (60)
[9426:0409/110859:INFO:CONSOLE(63)] "am-i-set: true (expect this to `true`)", source: /Users/corey/github/atom/src/window-event-handler.coffee (63)

[atom] a -d -f
[9685:0409/110902:INFO:CONSOLE(56)] "-- start --", source: /Users/corey/github/atom/src/window-event-handler.coffee (56)
[9685:0409/110902:INFO:CONSOLE(58)] "am-i-set: null (expect this to be `null` the first time and `true` the second)", source: /Users/corey/github/atom/src/window-event-handler.coffee (58)

I would expect am-i-set to be true, but it is null. If I close the window cmd-shift-W before I close the app everything works fine and am-i-set is set to true.

If this turns out to be too much work let me know and I will just reimplement localStorage on Atom and have it write to disk.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions