Repository navigation
id(groups): refuse duplicate/self predecessors and duplicate create members in group.event codec - #5246
Merged
Conversation
…embers in group.event codec check_bounds counted after/create members but never deduplicated them and never compared after to the event own id, so the wire codec encoded and decoded duplicate predecessors, self-predecessor cycles, and duplicate create members that sibling codecs (chain DuplicateAfter, fold BadMembers) refuse. The shared encode/decode gate now refuses all three with EventError::Shape naming the duplication, with tests covering encode and hand-built-CBOR decode for each. Fixes #5217. Queue task 8952.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
5 tasks
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 #5217.
Change
pkgs/id/src/groups/event.rs—check_bounds(the single gate shared byencode_group_eventanddecode) countedafterpredecessors and create members but never deduplicated them and never comparedafterto the event's own id. It now refuses, each with anEventError::Shapenaming the duplication:after(mirrorschain.rsDuplicateAfter),afterentry equal to the event's own id (self-predecessor),fold.rsBadMembers).No wire format, TAG, or VERSION change; fold/projection semantics untouched.
Tests
New test
group_event_wire_rejects_duplicate_self_and_member_repeatscovers all three refusals on both the encode path and the decode path (hand-built CBOR envelopes; the duplicate-member decode case splices a second entry for the same key with a conflicting role into a valid create envelope).Laptop (worktree from origin/main):
cargo test --lib groups::event— 6 passed (incl. the new test; round-trip + golden vectors stay green)cargo test --lib groups::— 116 passedrustfmt --check src/groups/event.rs— cleanQueue task 8952 · branch
queue/8952-5217-groupevent-dedupOpen in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.