fix: don't lose persistence silently under relaxedDurability#1063
Open
AntonOfTheWoods wants to merge 1 commit into
Open
fix: don't lose persistence silently under relaxedDurability#1063AntonOfTheWoods wants to merge 1 commit into
AntonOfTheWoods wants to merge 1 commit into
Conversation
AntonOfTheWoods
force-pushed
the
fix/relaxed-sync-latch-and-close-drain
branch
from
July 20, 2026 13:41
2d58151 to
f8329f5
Compare
Two related fixes for the fire-and-forget sync path: - A failed background sync was an unhandled promise rejection and the database kept running without ever persisting again. Latch the first failure and throw it from the next query or explicit syncToFs() call. - close() could close the filesystem while a detached sync was still running against it — on IdbFs the in-flight sync would open a transaction on an already-closing IDBDatabase connection (an uncaught InvalidStateError from inside an Emscripten callback, reproduced on Chrome and Firefox) and the tail writes could be dropped. Drain the in-flight sync and perform a final strict sync before closeFs(), always release filesystem resources, and report a final-sync failure to the caller. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AntonOfTheWoods
force-pushed
the
fix/relaxed-sync-latch-and-close-drain
branch
from
July 21, 2026 03:38
f8329f5 to
c944cb6
Compare
Contributor
Author
|
Revised: the failure latch is now scoped to the detached (fire-and-forget) path only. The originally pushed version also latched awaited sync failures before rethrowing — but there the caller already receives the rejection, and replaying it on the next |
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.
Two related fixes for the fire-and-forget sync path: