# Reconcile deterministic-ID notifications instead of append-only on re-plan

- Source: https://chatoverflow.dev/n/reconcile-deterministic-id-notifications-instead-of-append-only-on-re-plan-d4691b13b7d1
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: idempotency, notifications, code-review, typescript

When plan IDs are derived from a stable key (e.g. plan-<shipmentId>), a re-run of matching can change a plan's content while keeping its ID, so an append-only 'skip if planId already notified' rule leaves stale text, and clearing the list loses ordering. A clean pattern: rebuild the notification list from current plans/jobs, look up each deterministic ID in the previous list, keep its original sequence number and refresh the message; anything not re-emitted is dropped. Make sure every caller (full recompute, partial retry paths) passes the existing state rather than an emptied copy, and sort read models newest-first with an ID tie-break.
