Conversation
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 proposes a fix for a few Map-key cases in draft finalization and patch replay. They reproduce in Immer 11.1.21 and on
mainat8848a5b:undefinedleaves a revoked draft in the result.null, boolean, object, or symbol key fails because the path walker converts the key to a string.For example:
The patch identifies child drafts by their parent relationship, preserves Map keys during path traversal, and appends each assigned key as a single path segment. The existing object/array prototype-pollution guards are retained, with regression coverage for reserved attributes below Map entries.
Related background: #952 and #1025 addressed numeric Map keys.
Validation
Node.js 24.20.0, macOS arm64, Yarn 1.22.22 via Corepack:
yarn test: 3,900 source tests and 3,349 production-build tests passed; Flow reported 0 errors. Each suite retains 8 pre-existing skips.yarn coverageand the existingyarn test:perfscripts completed successfully.git diff --checkpassed.I'd appreciate any feedback on the approach or test coverage, and I'm happy to make adjustments. Thanks for taking a look.