Skip to content

fix(web): crashes on Automation settings, /alerts and repeated Connect clicks - #2086

Merged
Makisuo merged 3 commits into
mainfrom
fix/web-retired-destination-crash
Nov 1, 2026
Merged

Makisuo merged 3 commits into
mainfrom
fix/web-retired-destination-crash

fix(alerts): retire hazel-oauth ids from each rule's severity tiers t…

e00f6da
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Nov 1, 2026 in 32s

Confidence 8/10 · No issues found

🟢 Confidence 8/10 · likely safe to merge. Held at 8 because a fix has not been re-checked against the whole diff yet.
no findings · tests covered · risk high −1 · 1 fix not yet re-checked against the whole diff

The head strips hazel-oauth ids from every thresholds_json tier as well as the rule columns, and pins the whole migration with a PGlite fixture over mixed, hazel-only, untouched and malformed rows. Both earlier findings are addressed; safe to merge.

  • Second alert_rules UPDATE removes retired ids from each severity tier's destinationIds, keeping tier order
  • migrations.test.ts seeds four rules, two policies and delivery rows and asserts the surviving jsonb

Before merge

Fixed since the last review

  • ✅ F1 · Migration cleans destination_ids_json but leaves the ids in thresholds_json tiers
  • ✅ F2 · The new data migration has no PGlite test

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
apps/web/src/page/alerts/editor/derive-rows.ts 28 preview 28/day, 11.3% err
What was checked
  • Tier rewrite keeps tiers without a destinationIds array untouched and orders output by WITH ORDINALITY position (migration.sql:30)
  • The only FK into alert_destinations is alert_linear_issues, onDelete: "cascade" (tables/alerts.ts:304), so the final delete needs no extra cleanup
  • Escalation rewrite is skipped entirely when any rule's destinationIds is not an array (migration.sql:92)

e00f6da · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.