Repository navigation
Fix native signatures for ydoc_clear, XML navigation and bool returns - #136
Merged
SebastianStehle merged 1 commit intoOct 12, 2026
Merged
Conversation
SebastianStehle
requested changes
Oct 9, 2026
…returns ydoc_clear takes a parent write transaction that was never passed, so the native side read an indeterminate pointer. yxmlelem_parent and yxmlelem_first_child take only the branch, and ydoc_should_load and ydoc_auto_load return uint8_t, which must not be marshalled as a 4-byte BOOL. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
jcannon98188
force-pushed
the
fix/native-signature-mismatches
branch
from
October 11, 2026 16:31
ef69107 to
145d107
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.
Summary
Fixes #133
Corrects five P/Invoke declarations that did not match the yffi C API.
Changes
ydoc_clearnow receives its parent write transaction. For a document with a parent we open a write transaction on the parent. A root document has no parent, so a transaction on a throwawayDocis used. yffi 0.19 and 0.26 panic on null.yxmlelem_parentandyxmlelem_first_childno longer pass an extratransactionargument.ydoc_should_loadandydoc_auto_loadreturn a single byte:[return: MarshalAs(UnmanagedType.U1)].Tests
Added to
Document/ClearTests:ClearsManyDocumentsWithContentClearsSubDocumentReadFromParentReportsLoadFlagsFromOptionsFull unit suite against yrs 0.19.1: 441 passed, 8 skipped.
These are regression guards. The original bugs read indeterminate values, so they cannot be made to fail deterministically.
Notes
nint.Zerohere.🤖 Generated with Claude Code