Skip to content

fix(ui): refresh Public badges after sharing changes - #169078

Merged
steipete merged 1 commit into
mainfrom
codex/qa1042-sharing-invalidation
Oct 11, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa1042-sharing-invalidation

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Before the fix, the mounted Gateway-event regression and Chromium header capture both left the Public badge absent after another client's publication event. The same Chromium scenario passes after the fix; inspected synthetic before/after screenshots accompany this PR.
  • The two new mounted cases cover ordinary and agent-scoped global sessions, unrelated-agent events, publication, broad revocation, and stale in-flight responses.
  • 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.
  • Production UI and UI-chat test typegraphs, scoped lint/stylelint, formatting, and git diff --check pass.
  • Fresh managed Codex review is scoped-clean with no actionable P0–P2 findings.

Before: sharing changed in another client but the Public badge remains absent

After: the Public badge reflects the current sharing state

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.
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 11, 2026 11:06
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: S labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Refresh the chat header’s Public badge when another window changes session sharing.

Example: Another window publishes the saved session “Design review”.

  • Before: The already-open chat header continues to omit the Public badge.
  • After: The sharing event triggers fresh sharing data, and the header displays Public.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, focused repair with sound cache ownership and meaningful mounted regressions.
Proof confidence 🦐 gold shrimp (3/6) The supplied maintainer association exempts this PR from the ordinary contributor proof gate; inspected synthetic Chromium captures show the changed header, while mounted regressions cover event-to-hydration behavior without demonstrating the complete two-window app flow.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An already-open chat header displays stale publication status after another window changes public access.
Reason: Accurate publication status fulfills the existing feature contract, and the feature owner authored this focused repair.

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
Reviewed head: 6203eed1e03eb53768b4e55a75f877a64d540846

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not show publication and revocation updating an already-open header across two windows in the complete Control UI.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Sharing cache and header hydration keeps the original intent (48307ec: Keep Public indicators consistent with durable publication state while retaining connection, session-generation, and request ownership.)
  • Sharing-event lifecycle handling keeps the original intent (6a723ed: Invalidate media admission before sharing withdrawal reaches roster refresh.)
  • Public-sharing documentation keeps the original intent (8787ee0: Use canonical thread URLs for public reading while preserving private access controls.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 48307ec adds ui/src/pages/chat/chat-pane-sharing.ts:24 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 48307ec958b0; files: ui/src/pages/chat/chat-pane-sharing.ts)
  • RoboClaw: Raw commit 6a723ed adds ui/src/pages/chat/chat-pane-lifecycle.ts:430 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 6a723ed4a41e; files: ui/src/pages/chat/chat-pane-lifecycle.ts)

PR surface

Source +22, Tests +126, Docs 0. Total +148 across 4 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 2 22 0 +22
Tests 1 126 0 +126
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 149 1 +148

Review metrics

Metric Value Why it matters
Production versus test growth Production +22/−0; tests +126/−0 The focused invalidation repair gains mounted coverage for event delivery, conversation identity, and stale-response handling.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The header can misrepresent publication state across windows, while Gateway permissions and public-access enforcement remain unchanged.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Optionally show publication and revocation updating an already-open header across two windows in the complete Control UI.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-11T11:12:14.460Z sha 6203eed :: needs maintainer review before merge. :: none

Reviewed October 11, 2026, 7:22 AM ET / 11:22 UTC (Revision 2).

@steipete
steipete merged commit 0921dc6 into main Oct 11, 2026
145 of 150 checks passed
@steipete
steipete deleted the codex/qa1042-sharing-invalidation branch October 11, 2026 12:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant