sqlite: copy changeset before applying it - #65286
Open
mcollina wants to merge 2 commits into
Open
Conversation
SQLite can invoke JavaScript conflict and filter callbacks while applying a changeset. Copy the input first so detaching or modifying its backing buffer during a callback does not affect the active operation. Signed-off-by: Matteo Collina <hello@matteocollina.com>
Collaborator
|
Review requested:
|
mcollina
requested review from
Renegade334 and
trivikr
and removed request for
trivikr
August 14, 2026 14:41
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65286 +/- ##
==========================================
- Coverage 90.30% 90.10% -0.21%
==========================================
Files 759 752 -7
Lines 247597 252224 +4627
Branches 46679 47449 +770
==========================================
+ Hits 223591 227258 +3667
- Misses 15469 16277 +808
- Partials 8537 8689 +152
🚀 New features to boost your workflow:
|
geeksilva97
reviewed
Aug 14, 2026
Refactor: only copy the changeset before applying it when a filter or onConflict callback is present, since SQLite can only invoke JavaScript mid-apply in that case. Without callbacks, the input buffer cannot be detached or modified during sqlite3changeset_apply(), so no copy is needed and the buffer is passed through directly. Address review comment from geeksilva97. Signed-off-by: Matteo Collina <hello@matteocollina.com>
trivikr
reviewed
Aug 20, 2026
jasnell
approved these changes
Aug 20, 2026
Collaborator
geeksilva97
approved these changes
Aug 20, 2026
Collaborator
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.
SQLite can invoke JavaScript conflict and filter callbacks while applying a changeset. Copy the input first so detaching or modifying its backing buffer during a callback does not affect the active operation.