Skip to content

auth: detach empty model-state maps when cloning - #5798

Open
aikins01 wants to merge 1 commit into
router-for-me:devfrom
aikins01:auth/detach-empty-model-states
Open

aikins01 wants to merge 1 commit into
router-for-me:devfrom
aikins01:auth/detach-empty-model-states

Conversation

@aikins01

Copy link
Copy Markdown
Contributor

Auth.Clone currently shares ModelStates when the map is non-nil but empty. Inserting the first model state into either the original or a clone then mutates both, despite the clone contract to duplicate maps.

Allocate a separate map for every non-nil ModelStates, preserving nil maps and the existing cloning of populated states. The regression covers independent insertions into the original, a snapshot, and a clone of that snapshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant