Skip to content

fix(ui): keep invitation dismissed after failed save and reload - #163048

Open
jesse-merhi wants to merge 1 commit into
mainfrom
fix/community-invite-reload
Open

jesse-merhi wants to merge 1 commit into
mainfrom
fix/community-invite-reload

Conversation

@jesse-merhi

@jesse-merhi jesse-merhi commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: the dismissed Discord invitation returns after a Control UI reload when the browser rejects saving the dismissal to permanent storage.

User Impact

The invitation stays dismissed in the current tab through the “Server updated” refresh action and failed-load “Try again” recovery. Successful permanent saves retain their existing behavior. If both browser stores reject writes, dismissal lasts only until the current page is replaced; closing the tab also loses a session-only dismissal.

Why This Change Was Made

A failed permanent save previously left dismissal only in module memory, which a full document reload resets. Record that dismissal in session storage when permanent storage fails, and check it before admitting the invitation. Keep the existing warning because the fallback does not persist after the tab closes.

Change Breakdown

Part Files +LOC -LOC
Implementation 1 +16 -10
Tests and fixtures 2 +105 -5
Total 3 +121 -15

Evidence

Matched Chromium recordings at 1280×900 with an isolated, same-origin mocked Gateway. Both runs force QuotaExceededError on the invitation’s localStorage write, emit the production build-mismatch response, and click the actual Server updated button. The before run uses the original dismissal implementation; the after run uses this PR’s implementation.

After the same refresh: invitation returns before the fix, stays dismissed after it

Before — dismiss, then refresh; the invitation returns.

before.mp4

After — dismiss, then refresh; the invitation stays hidden.

after.mp4
Observation Before: invitation returns After: invitation stays dismissed
Immediately after clicking dismiss Hidden Hidden
After the refresh opens a new document 1 invitation card visible 0 invitation cards

The regression test additionally checks zero invitation mounts in the new document, guarding against a brief flash. It then deliberately fails the entry-module load, clicks the actual Try again action, and again observes zero cards and zero mounts.

Supporting validation:

  • Nine storage-owner unit cases pass. Existing browser coverage for healthy permanent saves, reconnects, same-origin Gateway switching, and deployment policy passes.
  • Focused UI production/test type checks, scoped formatting and lint pass. Independent review found no supported issues.
  • The Control UI production build passes, including bundle budgets.

Measured local timings from the verified test runs (Node 24, Chromium for browser coverage):

Test file and scope Result Measured time
ui/src/components/community-invite-state.test.ts — complete file 9 passed 1.76 s Vitest duration; 3.22 s repository test wrapper
ui/src/e2e/community-invite-showing.e2e.test.ts — keeps a failed-save dismissal regression 1 passed, 9 skipped by filter 5.082 s scenario; 7.47 s Vitest duration

Validation limits:

  • The initial local broader changed-file gate stopped on Promise.withResolvers type errors in src/gateway/auth.test.ts:355–356. The unchanged baseline reproduces the same errors. Earlier guards, changed-file formatting, graph boundaries, and UI i18n verification pass; the full gate is not green.
  • Exact-head CI and security checks passed in CI run 36939642036.
  • Live Chrome inspection showed successful permanent saving and persistence through ordinary reload. The stale-UI prompt was absent, so the cause of the reported live incident remains unconfirmed.

How to Verify

With repository dependencies and Playwright Chromium available:

node scripts/run-vitest.mjs \
  --config test/vitest/vitest.ui-e2e.config.ts \
  ui/src/e2e/community-invite-showing.e2e.test.ts \
  -t 'keeps a failed-save dismissal'

The test forces the stale-UI reload and failed-load recovery. After each navigation, invitation policy is confirmed enabled, but no invitation card may mount.

@clawsweeper

clawsweeper Bot commented Oct 1, 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The Control UI saves invitation dismissals in tab storage when permanent saving fails, keeping the invitation hidden through reloads and recovery.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, compatible repair with direct visible browser proof and useful regression coverage.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The inspected before/after Chromium image directly shows the dismissal owner’s visible result after forced permanent-save failure and refresh. Source-inspected browser coverage additionally exercises recovery and prevents a brief remount. Videos could not be viewed because ffprobe was unavailable and browser fallback failed; existing permanent-state compatibility is supported by unchanged format and covering cases.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on current main. The patch preserves existing dismissals, addresses the reload failure narrowly, and has convincing browser evidence; no actionable correctness or security finding remains.

Priority: P2
Reviewed head: 990f9ffb66e4072d7990e3460c0c943576e46776

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI sidebar combines the deployment’s invitation policy with browser-local dismissal preferences. Its dismissal owner determines whether the Discord invitation can appear after mounting or reloading the page.

flowchart TD
  A[Deployment invitation policy] --> E[Sidebar eligibility]
  B[Dismiss invitation] --> C[Permanent browser storage]
  C -->|Save fails| D[Tab storage fallback]
  C --> E
  D --> E
  E --> F[Invitation hidden or shown]
Loading

Technical review

Best possible solution:

Keep one dismissal owner that preserves permanent preferences and uses tab storage for failed-save recovery without claiming permanent persistence.

Do we have a high-confidence way to reproduce the issue?

Yes: reject the invitation’s permanent-storage write, dismiss it, and replace the document through the refresh control. Current-main source establishes the failure, and supplied browser evidence demonstrates it; this review did not execute tests.

Is this the best way to solve the issue?

Yes: extending the existing dismissal owner with a tab-scoped fallback is narrow and preserves permanent-save behavior and its warning contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e1d4dcc81a5c.

Security

None.

Evidence

What I checked:

  • Introduced change and merge ownership: The pinned introduction changes only the dismissal owner and its unit/browser coverage. Raw test-merge parents match the pinned base followed by the exact PR head; its production delta retains the same focused change. (ui/src/components/community-invite-state.ts:15, bb0f928275bf)
  • Current main still needs the repair: Current main retains failed dismissals only in module memory. A new document resets that memory while the failed permanent write leaves no marker. (ui/src/components/community-invite-state.ts:22, e1d4dcc81a5c)
  • Latest-release comparison: The supplied latest release also contains the module-memory-only implementation, without a session-storage fallback. (ui/src/components/community-invite-state.ts:22, c074824a27c9)
  • Existing-state compatibility: The permanent storage key, timestamp object, malformed-marker suppression, success result, and failure warning remain intact. The added session marker is consulted only as another suppression source; existing unit and browser cases cover permanent markers and their persistence. (ui/src/components/community-invite-state.ts:29, 990f9ffb66e4)
  • Browser boundary coverage: The expanded browser scenario rejects only invitation localStorage writes, invokes the actual Server updated and Try again controls, verifies enabled deployment policy, and asserts zero invitation mounts after document replacement. Its shared mock setup does not seed a dismissal when communityInviteDismissed is false. Tests were inspected, not executed during this read-only review. (ui/src/e2e/community-invite-showing.e2e.test.ts:524, 990f9ffb66e4)
  • Inspected before/after browser proof: The downloaded comparison image visibly shows the invitation after refresh before the fix and its absence afterward. The captured PR body identifies matched Chromium runs with forced permanent-save failure and the production refresh control. Video preparation failed with ffprobe ENOENT, and browser fallback returned Cache miss; neither video was independently viewed. The screenshot directly demonstrates the changed visible state. (990f9ffb66e4)

PR surface

Source +6, Tests +100. Total +106 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 16 10 +6
Tests 2 105 5 +100
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 121 15 +106

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a limited browser preference failure without blocking the main agent workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 (5 earlier review cycles)
  • reviewed 2026-10-01T22:41:58.355Z sha 990f9ff :: needs changes before merge. :: none
  • reviewed 2026-10-01T22:51:39.818Z sha 990f9ff :: needs changes before merge. :: none
  • reviewed 2026-10-01T23:12:25.492Z sha 990f9ff :: needs changes before merge. :: none
  • reviewed 2026-10-01T23:17:35.907Z sha 990f9ff :: needs maintainer review before merge. :: none
  • reviewed 2026-10-01T23:24:48.241Z sha 990f9ff :: needs maintainer review before merge. :: none

Reviewed October 1, 2026, 7:32 PM ET / 23:32 UTC (Revision 6).

@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Oct 1, 2026
@jesse-merhi
jesse-merhi marked this pull request as ready for review October 1, 2026 23:13
Copilot AI balanced review requested due to automatic review settings October 1, 2026 23:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jesse-merhi

Copy link
Copy Markdown
Member Author

/clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 1, 2026
@jesse-merhi

Copy link
Copy Markdown
Member Author

/clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

obviyus added a commit that referenced this pull request Oct 14, 2026
…1748)

## What Problem This Solves

Fixes: community invitation browser checks time out after the empty sidebar footer was removed in f8ae13e (#171644), leaving unrelated PR CI red.

## User Impact

No user-visible change. Developers regain working invitation policy and dismissal checks without restoring the intentionally removed footer.

## Why This Change Was Made

Wait for the always-present `openclaw-app-sidebar`, already used for sidebar readiness in this file and neighboring E2E tests, instead of the optional developer-branch footer. Only the three stale readiness selectors change; every invitation policy and dismissal assertion remains unchanged.

This maintainer-authorized inherited-CI repair is separate from #169564. Related: #163048 (jesse-merhi), which changes dismissal behavior in the same file; this diff is limited to three selectors to minimize overlap.

No overlap with Pash/Sarah changes.

## Evidence

Ran only `ui/src/e2e/community-invite-showing.e2e.test.ts`, serially through pueue:

- Before, clean `origin/main` at `a0b8fa311ada729074f901bd87995e64703a1d42`: **8 passed, 2 failed**, 99.48s. Both failures waited 30 seconds for `.sidebar-shell__footer` at lines 414 and 578.
- The same failures reproduced on #169564 head `1c8fdc4149f014fa64cadd99b9651414c4ac1cf0`: **8 passed, 2 failed**, 99.09s. [Matching CI failure](https://github.com/openclaw/openclaw/actions/runs/38510070617/job/115680348228).
- After, repair based on `06081b71dd9`: **10 passed**, 48.99s. The reload-loop readiness wait at line 446 is updated too, so the previously blocked policy assertions execute.

Command used for each focused run:

```sh
node --import ./scripts/tsx.mjs scripts/ensure-playwright-chromium.mts && node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/community-invite-showing.e2e.test.ts
```

No broad suites, full typecheck, check-changed, or autoreview were run, per the scoped repair request.

Merge danger: two-way door; a revert only restores test selectors. Blast radius is limited to invitation E2E readiness waits; no production behavior or persisted state changes.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
…nclaw#171748)

## What Problem This Solves

Fixes: community invitation browser checks time out after the empty sidebar footer was removed in 5afb600 (openclaw#171644), leaving unrelated PR CI red.

## User Impact

No user-visible change. Developers regain working invitation policy and dismissal checks without restoring the intentionally removed footer.

## Why This Change Was Made

Wait for the always-present `openclaw-app-sidebar`, already used for sidebar readiness in this file and neighboring E2E tests, instead of the optional developer-branch footer. Only the three stale readiness selectors change; every invitation policy and dismissal assertion remains unchanged.

This maintainer-authorized inherited-CI repair is separate from openclaw#169564. Related: openclaw#163048 (jesse-merhi), which changes dismissal behavior in the same file; this diff is limited to three selectors to minimize overlap.

No overlap with Pash/Sarah changes.

## Evidence

Ran only `ui/src/e2e/community-invite-showing.e2e.test.ts`, serially through pueue:

- Before, clean `origin/main` at `f81f8a6a9962078994a8a3ce66bba5be65728c35`: **8 passed, 2 failed**, 99.48s. Both failures waited 30 seconds for `.sidebar-shell__footer` at lines 414 and 578.
- The same failures reproduced on openclaw#169564 head `1c8fdc4149f014fa64cadd99b9651414c4ac1cf0`: **8 passed, 2 failed**, 99.09s. [Matching CI failure](https://github.com/openclaw/openclaw/actions/runs/38510070617/job/115680348228).
- After, repair based on `0d72af585a6`: **10 passed**, 48.99s. The reload-loop readiness wait at line 446 is updated too, so the previously blocked policy assertions execute.

Command used for each focused run:

```sh
node --import ./scripts/tsx.mjs scripts/ensure-playwright-chromium.mts && node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/community-invite-showing.e2e.test.ts
```

No broad suites, full typecheck, check-changed, or autoreview were run, per the scoped repair request.

Merge danger: two-way door; a revert only restores test selectors. Blast radius is limited to invitation E2E readiness waits; no production behavior or persisted state changes.

Co-authored-by: Ayaan Zaidi <[email protected]>

This branch has not been deployed

No deployments
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 P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants