mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-30 19:58:50 +00:00
Apply re-validated the preview token after both halves were durable, so a TTL that lapsed during the write, or an eviction by a newer preview of the same user, answered "preview expired" for a plan that was already replaced and withheld both update events. The token is now simply spent after the commit; validity is decided once, on entry under write_lock. Route runs dropped by drop_unknown_routes never reached the store unless a marker happened to be orphaned in the same pass; an idle robot kept them in memory only and a restart brought them back. The drop now happens under _refresh_lock, leaves with the orphan transaction or with an immediate write of its own, and rolls back like #335 when the store refuses. Tests: HA harness for both apply races and a live config/set route drop, recorder stubs for the four durability cases; five mutants caught by the standard runner. Issue: #495 User-Visible: yes