Skip to content

Correlate registration policy buckets by id instead of key when editing - #11891

Merged
nbudin merged 1 commit into
mainfrom
11870-correlate-buckets-by-id
Aug 7, 2026
Merged

Correlate registration policy buckets by id instead of key when editing#11891
nbudin merged 1 commit into
mainfrom
11870-correlate-buckets-by-id

Conversation

@nbudin

@nbudin nbudin commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #11870

RegistrationPolicy.build_from_hash now keeps a bucket's id (only the policy-level id is still stripped, to avoid aliasing a real persisted row). RegistrationPolicy#sync_buckets_from_hash! matches buckets primarily by id, 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 key changes, instead of being destroyed and recreated. The production editing flow (update_event/update_event_proposal via form_response_attrs_json) already round-trips bucket id today 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 the bucket_key/requested_bucket_key computed readers to work by id — and removing RegistrationPolicyBucket#key itself.

🤖 Generated with Claude Code

…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>
@nbudin nbudin added bug patch Bumps the patch version number on release labels Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
app/javascript/setupI18Next.ts 🟠 65.52% 🟠 72.41% 🟢 6.89%
app/models/registration_policy.rb 🟢 98.59% 🟢 98.68% 🟢 0.09%
Overall Coverage 🟢 55.99% 🟢 56.03% 🟢 0.04%

Minimum allowed coverage is 0%, this run produced 56.03%

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

Labels

bug patch Bumps the patch version number on release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Correlate registration policy buckets by id instead of key when editing/simulating policy changes

1 participant