ReviewOS

stacks/wildloop

Bump/guard the localStorage persist key so seed edits aren't masked

#988
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Problem

The tb store persists to trailbuddy-tb-v2; once set, edits to seed data (or schema) don't appear until the key is cleared/bumped — a frequent dev/test footgun and a stale-state risk after hydration shape changes.

Acceptance

  • Version the key and bump on schema change (or clear in dev), so hydration/seed changes take effect.
8 days ago

Addressed in f32efba.

The persist key was already versioned (trailbuddy-tb-v4; the v3→v4 bump shipped with the saved-trails work). The remaining gap was the discipline, so I documented it explicitly at the persist config: a persisted snapshot fully replaces seeded state on hydration, so any breaking store-shape change (renamed/removed field, changed enum vocabulary, or a new field older snapshots lack) MUST bump the -vN suffix — which invalidates stale snapshots so the new shape/seed actually takes effect. The comment now carries the full version history (v3 status enum, v4 savedTrailIds) as the running guardrail.

Sign in to comment on this issue.