Repository navigation
Fail loading when stored document data cannot be applied - #138
Open
jcannon98188 wants to merge 2 commits into
Open
jcannon98188 wants to merge 2 commits into
jcannon98188 wants to merge 2 commits into
Conversation
DocumentContainer ignored the result of ApplyV1, so undecodable stored data produced an empty document that the next write persisted over the original. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
SebastianStehle
approved these changes
Oct 9, 2026
…d data The fixture shared its fakes across tests, so StoreImmediately depended on test order. Its unconfigured storage fake also returned an empty array, which only loaded because the apply result used to be ignored. Recreate the fakes per test and return no stored document. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
|
Updated tests so they align with implementations behavior |
Collaborator
|
There are conflicts now |
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
Fixes #135
DocumentContainerignored the result ofApplyV1when loading a stored document. Undecodable data produced an empty document, and the next write replaced the stored record with it.Changes
LoadCoreAsyncchecks theTransactionUpdateResultand throws aYDotNetExceptionnaming the document and the result code.Tests
Added to
DocumentContainerTests:FailsWhenStoredDocumentCannotBeApplied: 12 ×0xFFas stored data. It expects aYDotNetException, and thatStoreDocAsyncis never called. Fails without the fix (Expected: <YDotNet.YDotNetException>) and passes with it.LoadsStoredDocument: a valid stored update still loads its content.DocumentContainerTests: 3 passed. I did not run the rest of the server test project, because the storage fixtures need databases.Notes
!= Ok, andOkis 0 either way, so this is independent of the result-code mapping fix inTransactionUpdateResultdoes not match the native error codes #130.🤖 Generated with Claude Code