-
Notifications
You must be signed in to change notification settings - Fork 9
fix: correct array sync to preserve identity matching #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
subomi
wants to merge
2
commits into
main
Choose a base branch
from
subomi/fix/fix-syncing-array
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+137
−24
Conversation
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
…perations Fixed a bug in syncArraySlice where the target array was prematurely truncated by position before reorderArrayElements could match elements by RootNode identity. This caused elements at higher indices to be discarded even when they should have been matched and retained. The fix defers array resizing until after the sync loop completes, allowing reorderArrayElements to search all target elements for identity matches first. Added dereferenceToLastPtr utility for cleaner pointer chain handling. Added TestSync_ArraySubset_Debug to verify syncing a smaller high-level model (3 items) to a larger pre-existing core model (6 items) correctly matches by identity, removes unmatched items, and preserves the correct order. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Rename TestSync_ArraySubset_Debug to TestSync_ArraySubset_Success - Remove debug logging statements - Simplify comments to be more concise and professional - Remove unused TestSimpleArrayModel and TestSimpleArrayHighModel - Update model comments to be clearer and less verbose 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
📊 Test Coverage ReportCurrent Coverage: Coverage Change: ✅ No change Coverage by Package
📋 Detailed Coverage by Function (click to expand)
Generated by GitHub Actions |
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.
correct array sync to preserve identity matching during subset operations
Fixed a bug in syncArraySlice where the target array was prematurely truncated by position before reorderArrayElements could match elements by RootNode identity. This caused elements at higher indices to be discarded even when they should have been matched and retained.
The fix defers array resizing until after the sync loop completes, allowing reorderArrayElements to search all target elements for identity matches first. Added dereferenceToLastPtr utility for cleaner pointer chain handling.
Added TestSync_ArraySubset_Debug to verify syncing a smaller high-level model (3 items) to a larger pre-existing core model (6 items) correctly matches by identity, removes unmatched items, and preserves the correct order.
🤖 Generated with Claude Code