Skip to content

group: fix group-cache permission races - #62

Merged
purpshell merged 1 commit into
mainfrom
codex/group-cache-permission-races
Nov 12, 2026
Merged

purpshell merged 1 commit into
mainfrom
codex/group-cache-permission-races

Conversation

@purpshell

@purpshell purpshell commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Split out of #53 so that PR stays a pure upstream sync. Stacked on #53.

getCachedGroupData now returns a copy of the cached group metadata, including the member and admin slices, taken while groupCacheLock is held. Send-permission checks read that copy after the lock is released, so group notifications can no longer race those reads.

Test: TestCachedGroupSnapshotIsolation in group_cache_snapshot_test.go; go test -race ./... passes.


Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Group send-permission checks now use a consistent snapshot of participant and administrator information, improving reliability when group updates arrive concurrently.
    • Previously returned group metadata snapshots remain unchanged when later participant or administrator notifications are received. Changes made to a snapshot also no longer affect the group’s cached information.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Walkthrough

Group-cache reads now return copied metadata with copied member and admin slices. Tests cover snapshot isolation after updates and caller edits, plus concurrent notification updates and permission checks. The changelog records the behavior.

Changes: Group cache snapshots

Layer / File(s) Summary
Clone cached group metadata
group.go, group_cache_snapshot_test.go, CHANGELOG.md
getCachedGroupData now returns cloned metadata on cache hits and after fetches. The new clone method copies the struct and its member and admin slices. Tests cover snapshot isolation and concurrent permission checks. The changelog notes the copy behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • polymorfa/hypermeow#53: Introduces the group-cache metadata and permission-check path that this change updates.

Suggested reviewers: tulir

Merge Risk: Minimal · up to f6ced

Group send-permission checks now read a private copy of the cached group data, which removes the race with group notification updates. No remaining merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: group-cache permission races are fixed. The changeset returns cloned group-cache metadata (including Members and Admins slices) under lock, which addresses those races…
Description check Passed The description covers the change and its rationale: cached metadata is copied under groupCacheLock, and permission checks then read the copy after release. It also names the test added and reports a …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: group-cache permission races are fixed. The changeset returns cloned group-cache metadata (including Members and Admins slices) under lock, which addresses those races. The title is concise and specific, with no noise or vague terms.

Full details: Description check

Explanation

The description covers the change and its rationale: cached metadata is copied under groupCacheLock, and permission checks then read the copy after release. It also names the test added and reports a passing go test -race run. The template requires only a contributing-guidelines checklist item, and the description does not include it. That is a non-critical gap, so the description is mostly complete.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: b34e857e-706b-4835-a7b3-e2c4dc791116
Commits

Reviewing files that changed from the base of the PR and between 4251070 and 49549d2.

Files selected for processing: 3

  • CHANGELOG.md
  • group.go
  • group_cache_snapshot_test.go

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T14:48:15.172175Z 49549d2 Manual request
🔒 Security Review ✅ Completed 2026-11-12T14:50:23.842093Z 49549d2 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@purpshell
purpshell changed the base branch from codex/upstream-sync-20261027 to codex/newsletter-observations-20261027 November 12, 2026 12:57
@purpshell
purpshell force-pushed the codex/group-cache-permission-races branch from 2fc903e to 4716a06 Compare November 12, 2026 12:57
@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 4716a061e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 4716a061e1

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@purpshell
purpshell force-pushed the codex/group-cache-permission-races branch from 4716a06 to a74e315 Compare November 12, 2026 13:13
@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: a74e31578b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: a74e31578b

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@purpshell
purpshell changed the base branch from codex/newsletter-observations-20261027 to main November 12, 2026 14:46
@purpshell
purpshell force-pushed the codex/group-cache-permission-races branch from a74e315 to 49549d2 Compare November 12, 2026 14:46
@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 49549d27a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 49549d27a0

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@purpshell
purpshell added this pull request to stack #67 November 12, 2026 14:57
@purpshell
purpshell force-pushed the codex/group-cache-permission-races branch from 49549d2 to f6ced32 Compare November 12, 2026 19:30
@purpshell
purpshell merged commit 7ced325 into main Nov 12, 2026
4 of 5 checks passed
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