Summary
Stale incidents can persist when the planner outputs zero desired cells because pruning is skipped in that state.
Observed in
hooks/incidentSubscription/reconcile.ts:33
shouldPruneByCell becomes false when desiredCells.length === 0
hooks/incidentSubscription/useIncidentSubscriptionCore.ts:443
- stale-by-cell pruning only runs when
shouldPruneByCell is true
User Impact
Users can continue seeing old/irrelevant incidents ("ghost incidents") even after active desired coverage becomes empty (for example after map/location transitions), which makes the feed/map feel out of sync with current scope.
Repro (high level)
- Load incidents for an area.
- Transition to a state where planner returns zero desired cells.
- Observe that previously cached incidents can remain visible instead of being pruned for current scope.
Expected
When desired coverage is empty, incident state should still reconcile to current subscription scope and avoid persisting stale incidents.
Acceptance Criteria
- Incidents that are no longer in scope are not retained indefinitely when desired cells are empty.
- Reconcile behavior remains stable during transient planner states (no excessive flicker/churn).
- Add/adjust tests around zero-desired-cell reconciliation to prevent regressions.
Summary
Stale incidents can persist when the planner outputs zero desired cells because pruning is skipped in that state.
Observed in
hooks/incidentSubscription/reconcile.ts:33shouldPruneByCellbecomesfalsewhendesiredCells.length === 0hooks/incidentSubscription/useIncidentSubscriptionCore.ts:443shouldPruneByCellistrueUser Impact
Users can continue seeing old/irrelevant incidents ("ghost incidents") even after active desired coverage becomes empty (for example after map/location transitions), which makes the feed/map feel out of sync with current scope.
Repro (high level)
Expected
When desired coverage is empty, incident state should still reconcile to current subscription scope and avoid persisting stale incidents.
Acceptance Criteria