fix: make sure prototypes can be used for reregistration#1284
Merged
jakobmoellerdev merged 5 commits intoDec 4, 2025
Merged
Conversation
Previously, in the scheme we did not store by Prototype but by type. Because the scheme did not key by Prototype, one could register multiple defaults with the same underlying prototype value. However, this is incorrect. Instead there should be only one prototype instance at any given time in a scheme. If there are multiple registrations happening in succession, the prototype should still stay atomic, and all calls should instead only append to the aliases Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
5814660 to
0f323fd
Compare
Replaces the previous implementation of bidirectional mapping with a new `ListMap` structure for more efficient and compact internal handling. Adjusts all related methods to use stable pair index-based lookups. Updates impacted registry logic to utilize the new API. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Skarlso
reviewed
Dec 2, 2025
Skarlso
left a comment
Contributor
There was a problem hiding this comment.
I found a few interesting things, but I need to write some tests unless you can confirm my understanding. :D
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Skarlso
reviewed
Dec 3, 2025
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Skarlso
approved these changes
Dec 4, 2025
Contributor
|
Thanks for adding the tests! |
frewilhelm
approved these changes
Dec 4, 2025
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.
What this PR does / why we need it
Previously, in the scheme we did not store by Prototype but by type. Because the scheme did not key by Prototype, one could register multiple defaults with the same underlying prototype value. However, this is incorrect. Instead there should be only one prototype instance at any given time in a scheme. If there are multiple registrations happening in succession, the prototype should still stay atomic, and all calls should instead only append to the aliases
Which issue(s) this PR fixes
was discovered as part of scheme debugging in e25a7d0