Repository navigation
docs(web): warn on destructive version bump without migrate - #26
Conversation
Add a console.warn in storage.ts when a stored version is older than the current version and no migrate function was provided, making the silent data-wipe path visible during development. Add a comment above the createVersionedStorage call in coachStore.ts reminding future developers that bumping version without a migrate function discards all stored progress. Closes #19 Co-authored-by: Titux Metal <TituxMetal@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR makes the destructive “version bump without migrate” path in the web app’s versioned localStorage helper more visible, so future schema bumps don’t silently reset persisted state (notably Coach progress).
Changes:
- Add a warning when stored data is older than the current version and no
migratefunction is provided. - Add an inline comment at Coach progress persistence reminding that bumping the version without
migratediscards stored progress.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/web/src/lib/storage.ts | Emits a warning on the destructive fallback path when version is bumped without migrate. |
| apps/web/src/features/coach/stores/coachStore.ts | Documents the destructive reset footgun next to Coach progress persistence configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@claude Please address the Copilot review comment on this PR: In Follow project conventions: no semicolons, arrow functions only, named exports, |
|
Claude finished @TituxMetal's task in 2m 12s —— View job Addressing Copilot review comment
Change made in - if (parsed.version < version && !migrate) {
+ if (parsed.version < version && !migrate && import.meta.env.DEV) {The |
Co-authored-by: Titux Metal <TituxMetal@users.noreply.github.com>
Add a
console.warninstorage.tswhen a stored version is older than the current version and nomigratefunction was provided, making the silent data-wipe path visible during development.Add a comment above the
createVersionedStoragecall incoachStore.tsreminding future developers that bumping version without a migrate function discards all stored progress.Closes #19
Generated with Claude Code