Fix EventHint merge bug - #763
Merged
Merged
Conversation
Add test cases that demonstrate the bug where EventHints from different containers are incorrectly merged when they have compatible positions. The minimal test shows that when deleting from two text containers in the same transaction, only one event is generated instead of two, with the operations incorrectly attributed to a single container. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add container index tracking to EventHints to ensure hints from different containers are never merged. This fixes the issue where operations on different text containers in the same transaction would be incorrectly merged, causing events to be lost or misattributed. The fix wraps EventHint in EventHintWithContainer which includes the container index, and updates the merge logic to check container indices match before allowing merges. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
WASM Size Report
|
Merged
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.
Fix EventHint cross-container merge bug
Problem
When multiple containers are modified in the same transaction, their EventHints could be incorrectly merged together. This caused events to be lost or attributed to the wrong container
For example:
Would generate only 1 event instead of 2, with both operations incorrectly attributed to 'text_a'
Solution
Added container ID tracking to EventHints to prevent cross-container merging: