feat(status): recovery cleanup, override modal in Broadcast, suppression clear#7
Conversation
…ion clear - Recovery: prime in-memory state on subscription so users who tap Notify still get alerted even if the service never observed the monitor as down (process restart, brief blip). - Recovery + reports: clear active problem reports the moment a monitor flips from down to up — natural recovery and admin "Operational" override both wipe the reports. Manual recovery also dispatches the recovery web push without waiting on the stable window. - Status page: hide the per-monitor description when there's an active user-report or a manual override, since the override label / report badge already speaks for itself. - Status page: admin-only "Resume reports" button next to the suppression banner. New DELETE /uptimerobot/suppression endpoint clears the window. - Broadcast: title is now just "Broadcast"; new "Override service status" button opens the same modal as /status with a service picker inside. - Modal extracted to MonitorOverrideModal as a reusable component (used by both /status and /broadcast). - Copy: "Report a problem" -> "Report a Problem" (button + modal title).
|
Hey @ctlaltesc, thanks for submitting this PR! However, it looks like the PR template hasn't been fully filled out. Issues found:
Please update your PR description to follow the PR template. This check will automatically re-run when you edit your PR description. |
Adds two checkboxes to the per-user permission editor: - View Status Page (STATUS_VIEW = 1) — gates the /status page, the home-page banner, the sidebar entry, and GET /api/v1/uptimerobot. - Report a Problem (STATUS_REPORT = 536870912) — child of View Status Page; gates the Report-a-Problem button on /status and POST /api/v1/uptimerobot/reports. Both bits are unioned into the default-permissions setting so every new user has them on by default. A SQLite + Postgres migration ORs both bits into every existing user.permissions row so accounts created before this fork's status feature don't lose access. Both bit values were chosen to fit inside Postgres int4 (the existing column type for user.permissions): 2^0 was unused upstream and 2^29 was skipped between MANAGE_BLOCKLIST and VIEW_BLOCKLIST.
|
Closing — the work in this branch was cherry-picked onto Test status on the ported commits: 111 / 111 passing, server + client typecheck clean, prettier clean. The Generated by Claude Code |
Summary
Seven asks rolled into one commit:
1. Recovery notifications were not firing
The flow required
state.lastDownAtto be set, which only happens when the service observes the monitor as down during the current process's lifetime. If a user subscribed (e.g. from the home-page banner that's showing because the monitor briefly went down between polls), then the service restarted, then the monitor came back up — the recovery notification never fired becauselastDownAtwas undefined.Fix: at subscription time, call
service.primeRecovery(monitorId)which seedslastDownAt = nowif the monitor is currently observed non-up. Cold-start safe (no-op when the monitor is already up — there's nothing to recover from).2. Auto-clear reports on recovery (manual or automatic)
state.upSinceflips from unset to set (i.e., the monitor just transitioned from down → up), callclearActiveReportsForMonitorto mark every activeProblemReportrow resolved. Independent of the recovery-stable window — if the service is back up, the report badges should clear right away./uptimerobot/overridewithstatus: 'operational'while the previous effective status was anything other thanup, the route nowawaits the report-clear (so the 200 response already reflects an empty report list) and then fires the recovery web push fire-and-forget.3. Hide the per-monitor description when there's a report or override active
On the public Status page, the description line under a monitor is now suppressed if either condition is true:
manualStatusis set (the override label speaks for itself)4. "Report a problem" → "Report a Problem"
Updated the trigger button copy and the modal title (and any other surface that referenced the old casing).
5. "Broadcast Notification" → "Broadcast"
The page header on
/users/broadcastis now the simpler "Broadcast" — matches the sidebar entry.6. Manual status override modal on the Broadcast page
The override modal was extracted into
src/components/MonitorOverrideModal/as a reusable component with two operating modes:/status's pencil icon) — opens with the service already selected.The modal exposes a service
<select>, a status<select>(Automatic / Operational / Scheduled Maintenance / Degraded Performance / Partial Outage / Major Outage), a themed minutes input, an Apply primary button and a Clear secondary button.7. Clear-suppression button on /status
The suppression banner now renders a small admin-only Resume reports button next to it. New
DELETE /uptimerobot/suppressionendpoint (admin-gated, idempotent) setsreportsSuppressedUntil = undefinedand saves.Verification
--checkpnpm i18n:extractPOST /overrideclears active reports when set to operational;DELETE /uptimerobot/suppressionrejects non-admin / clears active window / idempotent on no window)form-row + text-label + form-input-area + form-input-field; Resume-reports button usesButton buttonType="warning"matching the suppression banner paletteTest plan
recoveryStableMinutesof the up observation./status, override a downed monitor to Operational. Confirm:Suppress problem reports (minutes) = 60. Confirm the Resume reports button appears next to the banner on/status. Click it; confirm the banner + button disappear andPOST /uptimerobot/reportssucceeds again./users/broadcast, confirm the page header reads Broadcast (not "Broadcast Notification").Select a service). Pick a service, choose a status, set minutes, click Apply. Confirm the override applies.https://claude.ai/code/session_01VNTFg16m3B9W14MnMcRqk8
Generated by Claude Code