Repository navigation
feat(alerts): incident-first alerts hub, timeline incident page, rebuilt rule editor - #1502
Confidence 6/10 · 1 issue to address
🟡 Confidence 6/10 · needs attention
The three earlier findings are verifiably fixed and tested; the incident route's missing failure branch is the one unguarded path, and its other hunks are already reviewed.
quality 88/100 · 1 warning · 1 note · tests partial · risk medium
The follow-up commit fixes the mode-switch, rule-summary and quiet-count findings, and keeps the revised incident page. One path in the incident route still reports a failed fetch as a missing incident.
- Switching a builder rule to Built-in now reports the split-by tokens it drops
ruleConditionSummaryprints builder thresholds in the display unit- The quiet-rule footer counts enabled rules with no lane, capped lanes included
- The incident route starts an investigation only on click, through
useAsyncAction
Findings
🟠 Warning · F5 · A failed incident-list fetch renders "Incident not found"
correctness · apps/web/src/routes/alerts/incidents/$incidentId.tsx:77-91
When useAlertIncidentsList returns a failure (a transient API or auth error), .orElse(() => []) leaves incidents empty and incident null while Result.isInitial is false, so the page claims the incident "may have been pruned, or the link is stale" instead of showing the failure. The delivery query in the same component does branch on Result.isFailure ($incidentId.tsx:253); the incidents and rules results get no such branch, so a fetch error is presented as a missing record with no retry.
Add a `Result.isFailure(incidentsResult)` branch before this one that renders `ErrorState` (or `ResourceNotFound` with a retry) so an API failure is not reported as a deleted incident.
Still open from earlier reviews
- 🔵 Note · F4 · The rail's "median" duration is the upper-middle value for an even count ·
apps/web/src/components/alerts/incident-detail/incident-rail.tsx:187
Fixed since the last review
- ✅
F1 · Switching a builder rule to Built-in silently drops its split-by tokens - ✅
F2 ·ruleConditionSummaryprints builder thresholds in the stored unit, not the display unit - ✅
F3 · The quiet-rule footer counts fired and capped lanes as quiet
What was checked
queryDraftToBuiltinnow names a lost split indropped(rule-modes.ts:115) and the test pins it- The quiet footer counts every lane's rule, enabled rules only (inbox-tab.tsx:254)
ruleConditionSummaryformats throughdisplaySignalTypeand the builder-aggregation test asserts5.0%
8dc0980 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Annotations
Check warning on line 91 in apps/web/src/routes/alerts/incidents/$incidentId.tsx
maple-review-bot / Maple / review
correctness: A failed incident-list fetch renders "Incident not found"
When `useAlertIncidentsList` returns a failure (a transient API or auth error), `.orElse(() => [])` leaves `incidents` empty and `incident` null while `Result.isInitial` is false, so the page claims the incident "may have been pruned, or the link is stale" instead of showing the failure. The delivery query in the same component does branch on `Result.isFailure` (`$incidentId.tsx:253`); the incidents and rules results get no such branch, so a fetch error is presented as a missing record with no retry.