Repository navigation
Fix: roll back meta document and storage instance when createRxCollection() fails in addCollections() - #9595
Open
pubkey wants to merge 2 commits into
Conversation
Contributor
✅ Verify Test Reproduction: Tests FAILED without the fix (expected)This confirms the changed tests correctly reproduce the bug that the source changes fix. This workflow runs the changed tests without the source fix to verify they reproduce the bug. Show output |
2 tasks done
…tion() fails in addCollections() Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015P6w6hnnyVPXwotts6YQ2F
… closed before the rollback The rollback of a failed collection creation is skipped when the database is closing or closed, and an error inside the rollback no longer replaces the creation error. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015P6w6hnnyVPXwotts6YQ2F
pubkey
force-pushed
the
claude/vigilant-newton-8rqsab-failed-collection-creation-leaves-meta-doc
branch
from
November 12, 2026 12:08
5dbb5fb to
01ff046
Compare
This branch has not been deployed
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.
This PR contains:
Describe the problem you have without this PR
addCollections()left the collection meta document and the storage instance behind when the creation of the collection failed after the storage instance was created (for example withCOL17), so that adding the collection again with an adjusted schema threwDB6Covers a failure inside
createRxCollection()after the storage instance exists, for exampleCOL17. pubkey/rxdb#9577 covers the case where the storage rejects the creation of the storage instance and changes the same block.multiInstance: when another tab adds the same collection at the same moment and succeeds while the creation in this tab fails, the rollback removes the storage instance and meta document that the other tab uses.COL17.Changed files:
orga/changelog/fix-failed-collection-creation-leaves-meta-document.jsonsrc/rx-database.tstest/unit/rx-database.test.tsTest output without the fix
The changed test file run on the memory storage with
src/frommaster:Test output with the fix
Todos
Assisted by
YES, CLAUDE CODE
Generated by Claude Code