fix: avoid IndexedDB handle writes during tab unload - #94
Merged
Merged
Conversation
Separate IndexedDB directory-handle storage from serializable session state so callers can avoid handle writes during page teardown. Capture the live active editor value for proactive state saves.\n\nRefs #92
Persist directory handles at workspace acquisition, debounce serializable editor state during normal interaction, and keep page unload synchronous. This avoids Chrome's native crash path while preserving session restore.\n\nRefs #92
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FileSystemDirectoryHandlepersistence from serializable session-state persistencebeforeunloadsynchronous and limited to compiler-worker terminationContext
Issue #92 was narrowed to an unload-time IndexedDB operation. Closing the extension without opening a folder did not crash, opening any folder did crash, and overriding
IDBFactory.prototype.opento throw before closing prevented the crash. The affected path calledpersistenceGate.persist()frombeforeunload, which opened IndexedDB and stored the live directory handle.This PR avoids that native Chrome crash path without changing STOP, compiler-worker replacement, terminal output, or the existing IndexedDB schema.
Verification
npm run test:e2e— passed, 199 testsnpm run lint— passednpm run build— passed; existing webpack bundle-size warnings onlynpm run test:browser:chrome— compiler/link preflight passed, then the existing hosted smoke path failed its unrelated xterm stream-output assertion because it read injected renderer CSS instead of terminal textManual QA required
The automated harness cannot obtain the same native
FileSystemDirectoryHandleused by the crash reproduction. Before merging, verify on the affected Chrome/macOS environment:Assumptions and limitations
Closes #92