Repository navigation
Periodically save state and store in indexedDB - #10605
Conversation
There was a problem hiding this comment.
Figured out this was an issue with binding saveStateSync before spying on it
|
Is this saved to .atom/storage ? |
|
@jeancroy thanks for your comment. To answer your question - yes, the atom environment state is saved to .atom/storage. That said, I'm going to create an unsaved text buffers store that will be located elsewhere (possibly using IndexedDB). So in the event of a crash and deletion of the storage folder, your unsaved buffers will be preserved. The unsaved buffer store will be a part of a separate pull request. I've updated the title of this one to be more specific as to what aspect of crash recovery will be addressed here. |
|
This is looking good! How long does |
|
I wonder if we can use requestIdleCallback here once we have chrome 47+ |
Yeah, we should start using that, as soon as #9627 lands |
There was a problem hiding this comment.
I think this should be called store... the convention in Node is to have async be implied and only mention sync vs async on a sync alternative.
|
Did some profiling. Here are durations for saveState (synchronous serialization, and async writing to disk):
*Marker Layer serialization took 8.3 ms large unsaved buffer (jquery, 10K lines) |
|
|
||
| @packages.loadPackages() | ||
|
|
||
There was a problem hiding this comment.
🔥 this trailing whitespace
|
Very solid work @kuychaco. I did a pretty quick scan and things look good to me. Are you thinking of adding the |
|
@nathansobo thanks for the review! I think I will add the command-line flag before merging. Hope to get that done tonight. |
(WIP) Periodically save state and store in indexedDB
|
💥 |
|
Hi @kuychaco Is there mechanism to migrate state data from previous format to the new IndexedDB format ? https://discuss.atom.io/t/upgrading-to-1-7-0-beta0-blew-away-my-session-any-way-to-restore/26918 |
|
cc @as-cii ☝️ |
|
Great to hear there is a fallback in the works. 👍
People (me) have even written a package to list / inspect / make use of session state. It really is a nice feature of Atom. |



Fixes atom/atom#4161