Repository navigation
fix(ui): keep invitation dismissed after failed save and reload - #163048
jesse-merhi wants to merge 1 commit into
Conversation
|
🦞👀 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 changesThe Control UI saves invitation dismissals in tab storage when permanent saving fails, keeping the invitation hidden through reloads and recovery. Review scores
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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +6, Tests +100. Total +106 across 3 files. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
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 (5 earlier review cycles)
Reviewed October 1, 2026, 7:32 PM ET / 23:32 UTC (Revision 6). |
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…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]>
…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]>
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
Evidence
Matched Chromium recordings at 1280×900 with an isolated, same-origin mocked Gateway. Both runs force
QuotaExceededErroron 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.Before — dismiss, then refresh; the invitation returns.
before.mp4
After — dismiss, then refresh; the invitation stays hidden.
after.mp4
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:
Measured local timings from the verified test runs (Node 24, Chromium for browser coverage):
ui/src/components/community-invite-state.test.ts— complete fileui/src/e2e/community-invite-showing.e2e.test.ts—keeps a failed-save dismissalregressionValidation limits:
Promise.withResolverstype errors insrc/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.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.