fix(sqlite): add an optimistic local commit protocol#193
Open
marcus-pousette wants to merge 1 commit into
Open
fix(sqlite): add an optimistic local commit protocol#193marcus-pousette wants to merge 1 commit into
marcus-pousette wants to merge 1 commit into
Conversation
marcus-pousette
force-pushed
the
fix/auth-stage-verified-proofs
branch
from
July 12, 2026 12:34
2b4b0a8 to
ea21857
Compare
This was referenced Jul 12, 2026
marcus-pousette
force-pushed
the
fix/sqlite-optimistic-local-commit
branch
from
July 12, 2026 12:44
416b21e to
644b31d
Compare
marcus-pousette
force-pushed
the
fix/auth-stage-verified-proofs
branch
from
July 13, 2026 14:07
ea21857 to
9122bce
Compare
marcus-pousette
force-pushed
the
fix/sqlite-optimistic-local-commit
branch
from
July 13, 2026 14:07
644b31d to
32bb026
Compare
marcus-pousette
force-pushed
the
fix/auth-stage-verified-proofs
branch
from
July 13, 2026 14:12
9122bce to
e4e2f30
Compare
marcus-pousette
force-pushed
the
fix/sqlite-optimistic-local-commit
branch
from
July 13, 2026 14:12
32bb026 to
fd77168
Compare
marcus-pousette
force-pushed
the
fix/auth-stage-verified-proofs
branch
from
July 13, 2026 15:14
e4e2f30 to
e4c5386
Compare
marcus-pousette
force-pushed
the
fix/sqlite-optimistic-local-commit
branch
from
July 13, 2026 15:14
fd77168 to
729a743
Compare
marcus-pousette
force-pushed
the
fix/auth-stage-verified-proofs
branch
from
July 13, 2026 15:22
e4c5386 to
54dab36
Compare
marcus-pousette
force-pushed
the
fix/sqlite-optimistic-local-commit
branch
2 times, most recently
from
July 13, 2026 15:30
0e2e6e4 to
f50f698
Compare
marcus-pousette
force-pushed
the
fix/auth-stage-verified-proofs
branch
from
July 13, 2026 15:30
54dab36 to
56bb9bb
Compare
marcus-pousette
force-pushed
the
fix/auth-stage-verified-proofs
branch
from
July 13, 2026 15:51
56bb9bb to
c911521
Compare
marcus-pousette
force-pushed
the
fix/sqlite-optimistic-local-commit
branch
from
July 13, 2026 15:51
f50f698 to
afa49f6
Compare
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.
Problem
SQLite authorization is asynchronous. Holding a savepoint while application auth runs can let unrelated same-connection work enter that savepoint and be rolled back by an auth rejection.
What changes
The native local-write functions expose two paths:
Prepare returns the exact proposal and a token bound to the document, clean materialization revision, and complete operation body. Commit takes the writer lock, rebuilds the operation, and returns an explicit conflict if state changed or the lock is busy.
The native layer rejects optimistic use inside a caller-owned transaction and rolls back every post-savepoint failure.
Fast paths
Tests
Stack
Stacked on #192. #194 adds the mandatory proof-bearing commit and #195 adds the TypeScript retry bridge.