Repository navigation
fix(ui): refresh Public badges after sharing changes - #169078
Conversation
Retire matching sharing cache and pending read slots when another client changes access. Reuse existing hydration and request ownership so late responses cannot restore stale badge state; preserve agent-qualified global identity and broad invalidation. Permissions remain Gateway-owned. Validation: original mounted and browser reproductions fail; 68 focused tests pass in 8.989s, new cases 167ms and 156ms, standalone file 4.553s. Production UI and UI-chat types, scoped lint/stylelint/format and diff checks pass. Fresh managed review is clean through P2. Inspected synthetic before/after captures document the rendered badge.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesRefresh the chat header’s Public badge when another window changes session sharing. Example: Another window publishes the saved session “Design review”.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a sharing-cache invalidation bug still present on current main; no actionable patch defects were found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI receives Gateway sharing events, invalidates conversation-scoped cached sharing data, and hydrates authoritative state for the chat header. flowchart LR
A[Sharing change] --> B[Gateway event]
B --> C[Chat pane lifecycle]
C --> D[Sharing cache invalidation]
D --> E[Existing sharing hydration]
E --> F[Public badge]
Technical reviewBest possible solution: Invalidate matching sharing caches on Gateway events and reuse existing hydration and request ownership. Do we have a high-confidence way to reproduce the issue? Current-main source shows sharing events leave the hydrated badge cache intact, consistent with the supplied before capture and reported baseline failure; no target code was run during this review. Is this the best way to solve the issue? The patch repairs the missing invalidation at the existing sharing owner, reuses canonical conversation matching, and rejects stale responses through existing request ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a17bd679979e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +22, Tests +126, Docs 0. Total +148 across 4 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 11, 2026, 7:22 AM ET / 11:22 UTC (Revision 2). |
|
Merged via squash.
|
Retire matching sharing cache and pending read slots when another client changes access. Reuse existing hydration and request ownership so late responses cannot restore stale badge state; preserve agent-qualified global identity and broad invalidation. Permissions remain Gateway-owned. Validation: original mounted and browser reproductions fail; 68 focused tests pass in 8.989s, new cases 167ms and 156ms, standalone file 4.553s. Production UI and UI-chat types, scoped lint/stylelint/format and diff checks pass. Fresh managed review is clean through P2. Inspected synthetic before/after captures document the rendered badge.
What Problem This Solves
The chat header's Public badge stays stale when another window enables or disables public access to the same session.
User Impact
Open chat panes reflect sharing changes without requiring a reconnect or opening the sharing menu. This fixes displayed state only; permissions and public-access policy are unchanged.
Why This Change Was Made
Sharing events invalidated media policy but left the pane's sharing cache hydrated. The existing sharing owner now retires matching cached state and in-flight reads, letting normal hydration fetch current sharing data. Conversation identity keeps agent-scoped global sessions separate, and broad invalidations refresh all cached sharing state.
Evidence
pnpm test ui/src/pages/chat/chat-pane-sharing-events.test.ts ui/src/pages/chat/chat-pane-sharing.test.ts ui/src/pages/chat/chat-pane-session-menu.test.ts --maxWorkers=1: 68 tests pass, 8.989s wall. New cases took 167ms / 156ms; the new file alone took 4.553s wall. Exact-head CI run 38134334961 passed. Complete UI shard jobs took 359s, 329s, and 371s, including setup; the UI E2E job took 80s.git diff --checkpass.