Repository navigation
fix: refresh notification settings after Web Push updates - #178640
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 changesRefreshes mounted notification controls when Web Push publishes changes to its mutable snapshot. Example: Enable browser notifications while Settings → Notifications remains open.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a current Settings rendering defect with a focused patch; no actionable code findings were identified. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Web Push capability publishes browser and Gateway notification state; Settings projects that state into rendered status, preferences, and action callbacks. flowchart LR
A[Browser and Gateway] --> B[Web Push capability]
B --> C[Owner projection]
C --> D[Settings presentation]
D --> E[Notification controls]
E --> B
Technical reviewBest possible solution: Retain the existing capability and projection owners, deriving a fresh notification presentation value at the Settings boundary. Do we have a high-confidence way to reproduce the issue? Current main exposes the stable mutable snapshot to an identity-sensitive Show boundary, matching the reported baseline mounted-test failure; this read-only review executed no tests or browser reproduction. Is this the best way to solve the issue? The shallow derived value is the smallest complete repair at the existing presentation boundary, and the added mounted regression covers the failure missed by direct snapshot assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b934ed20028c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +1, Tests +56. Total +57 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel 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 Reviewed October 20, 2026, 2:54 PM ET / 18:54 UTC. |
|
Fixed: notification Settings updates its status and actions after Web Push state changes without requiring a reload. |
…78640) Keep notification status, preferences and Unsubscribe current after Web Push state updates. Fixes openclaw#178631.
Fixes #178631
What Problem This Solves
Settings → Notifications can stay on Checking and Not requested after Web Push registration completes, leaving users without the Unsubscribe action until they reload. Progress publications can also leave the Enable notifications label unchanged while registration is running.
User Impact
The mounted Settings page updates its Web Push status, preferences and available actions when the existing notification capability publishes state. Browser consent, registration and unsubscribe behavior stay with their current owners. This change adds no configuration, permissions, persistence or dependencies.
Why This Change Was Made
Web Push updates one mutable snapshot in place. Settings already observes each capability publication, but forwards the same snapshot object through a downstream Solid equality check. The page now derives a shallow presentation value at that existing boundary so each publication reaches the rendered controls. Native notifications already replace their snapshot and are unchanged.
The regression mounts the existing ConfigPage once, publishes loading and registration/preferences updates from a stable snapshot, checks the visible controls, then clicks Unsubscribe and verifies the disable action. It exercises the rendering boundary that the existing direct snapshot assertions could not cover.
Evidence
On unchanged production baseline
432bada3bd86902d7486472f6dbc973e2d4898cf, the mounted regression fails because the button remains Enable notifications after the loading publication. The focused baseline command ispnpm test ui/src/pages/config/config-page.test.ts --maxWorkers=1 -t "renders Web Push registration publications"; Vitest reported 4.17s, with 5.52s for the native test invocation.The corrected tree passed changed-file formatting with Bun parity, source lint, UI catalog verification, and all 14 selected compiler graphs. The related test batch passed 139 cases across nine Settings files, including the complete ConfigPage file and its loading, granted/registered, preference and Unsubscribe assertions. The native test batch took 24.71s; its two Vitest shards took 9.16s and 11.26s. Hosted CI run 39473923740 passed. Its three UI unit rows took 432s, 376s and 365s, and its selected mocked UI E2E row took 116s; these include the wider selected suites, not just this regression.
Actual browser verification on a built integration runtime containing the same presentation change completed Ready → Subscribed/Granted → Ready/Not subscribed without reloading between the actions. Exactly one browser/Gateway registration and one unsubscribe completed, leaving no browser subscription. The owned test device was removed through its native owner and existing authority/configuration was preserved. Independent review accepted this evidence together with the public-head regression and CI.
The recording's integration producer is
d76083dff482e736914be6da5a237b736f76c4a8, distinct from public PR head7419dcdeba3810c347dc6ed545181d001bc825d1. Scoped source comparison confirms that the recorded baseline-to-candidate notification path differs only by this PR's snapshot-copy hunk. Browser permission was granted in the isolated test profile; this does not demonstrate a human consent dialog, and no notification delivery was tested. The older capture already showed Checking before Enable; the comparison establishes stale state after successful registration, not the cause of its initial Checking state.Visual evidence
Continuous registration and unsubscribe on the corrected integration runtime
notifications-enable-unsubscribe-continuous.mp4
Visual verification
d76083dff482e736914be6da5a237b736f76c4a8