Repository navigation
fix(alerts): maintenance window revision guard, locked org cap, shared weekdays - #2343
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Nov 7, 2026 in 1m 0s
Confidence 9/10 · No issues found
🟢 Confidence 9/10 · safe to merge. The revision guard and recount are pinned by new tests; the advisory lock itself is untested because PGlite serialises transactions.
no findings · tests partial −1 · risk medium
Replaces the millisecond updatedAt guard with a revision column bumped by every write, moves the 100-window cap count inside an org-scoped advisory lock, and de-duplicates the weekday literals. Safe to merge.
alert_maintenance_windows.revisionbumps on every update;syncWindowwrites only at the revision it readcreatecounts the per-org cap insidepg_advisory_xact_lock(org, 'alert_maintenance_windows')MAINTENANCE_WEEKDAYSmoves to@maple/domain/http; the MCP copy is deleted
Before merge
- Migration · Check it is safe on production data and with the code still deployed ·
packages/db/drizzle/20261107115926_alert_maintenance_window_revision/migration.sql
What was checked
- Only the service writes the window row (grep for update/insert/delete), so enable, disable and schedule edits all bump
revision selectMaintenanceWindowsspreads...$, sorevisionreachesfindRow, the materialize pages and the decoded row type- The advisory lock uses the transaction's
db, the same idiom aslockOrgAlertRules(AlertRulesService.ts:252)
d8eee5d · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading