Files
buzz/desktop/src-tauri
DuncanandWill Pfleger af2fa6994b fix(desktop): bind nest regen in cores, gate on highest-requested
Two review findings on the archive/unarchive nest-regen wiring.

Wrapper callback was unprotected. The Tauri command wrappers each
constructed the regeneration closure themselves (`|| try_regenerate_nest`)
before delegating, so the core tests proved a core forwards its callback
but never that either production command supplies one — no-oping either
wrapper's closure left the whole suite green. Bind regeneration to a
`NestRegenTrigger` type the cores invoke instead: the wrapper hands the
core its `AppHandle` as the trigger with no closure to construct, so the
'regenerate on success' selection lives inside the cores where the tests
traverse it. Each core's `|| regen.trigger()` is now RED-on-revert.

Regen gate permitted stale rollback. `NestRegenGate::commit` gated on
the highest *written* generation, which advances only when a newer
generation successfully writes. A newer request that failed during relay
work therefore left an older, stale render free to publish its obsolete
roster. Gate on the highest *requested* generation instead, advanced by
`claim` under the same lock `commit` reads — so once a newer generation
is requested no older one can publish, even if the newer one fails, and
a claim cannot race between an older task's eligibility check and its
write. Semantic delta: after a newer request fails, nothing publishes
until the next trigger.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-17 19:00:17 -04:00
..