Correlate registration policy buckets by id instead of key when editing - #11891
Merged
Conversation
…ng (#11870) RegistrationPolicy.build_from_hash now keeps a bucket's id (only the policy-level id is stripped), and sync_buckets_from_hash! matches buckets by id when one is given, falling back to key-matching otherwise. This lets an edited bucket's key be renamed without losing its row/identity, while keeping existing callers that don't supply bucket ids working exactly as before. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
This was referenced Aug 7, 2026
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.
Fixes #11870
RegistrationPolicy.build_from_hashnow keeps a bucket'sid(only the policy-levelidis still stripped, to avoid aliasing a real persisted row).RegistrationPolicy#sync_buckets_from_hash!matches buckets primarily byid, falling back to key-matching when the incoming hash doesn't carry an id — so callers that never round-trip an id (e.g. hand-built test hashes,import_convention_data_service) keep working exactly as before.This means an edited-but-existing bucket now keeps its real row/identity even if its
keychanges, instead of being destroyed and recreated. The production editing flow (update_event/update_event_proposalviaform_response_attrs_json) already round-trips bucketidtoday via Apollo cache data, so this take effect without any frontend changes.Deliberately out of scope (per the issue, deferred to follow-up work): converting
SignupBucketFinder,RegistrationPolicyBucket#signup_definitely_occupies_slot_in_bucket?,RegistrationPolicy#bucket_with_key,EventChangeRegistrationPolicyService's key-based removed-bucket/mapping logic, or thebucket_key/requested_bucket_keycomputed readers to work by id — and removingRegistrationPolicyBucket#keyitself.🤖 Generated with Claude Code