Skip to content

docs(web): warn on destructive version bump without migrate - #26

Merged
TituxMetal merged 3 commits into
developfrom
claude/issue-19-20260625-0310
Jun 25, 2026
Merged

TituxMetal merged 3 commits into
developfrom
claude/issue-19-20260625-0310

Conversation

@TituxMetal

Copy link
Copy Markdown
Owner

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

Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 25, 2026 03:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 migrate function is provided.
  • Add an inline comment at Coach progress persistence reminding that bumping the version without migrate discards 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.

Comment thread apps/web/src/lib/storage.ts Outdated
@TituxMetal

Copy link
Copy Markdown
Owner Author

@claude Please address the Copilot review comment on this PR:

In apps/web/src/lib/storage.ts line 66: gate the console.warn behind import.meta.env.DEV so it only runs in development builds and doesn't pollute the production console.

Follow project conventions: no semicolons, arrow functions only, named exports, bun run format:check + bun run lint:check + bun run typecheck must pass.

@claude

claude Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

Claude finished @TituxMetal's task in 2m 12s —— View job


Addressing Copilot review comment

  • Read apps/web/src/lib/storage.ts to understand current code
  • Gate console.warn behind import.meta.env.DEV
  • Run bun run format:check, lint:check, typecheck — all green
  • Commit and push — 170 tests pass, build succeeds

Change made in apps/web/src/lib/storage.ts:

- if (parsed.version < version && !migrate) {
+ if (parsed.version < version && !migrate && import.meta.env.DEV) {

The console.warn now only fires in Vite development builds (import.meta.env.DEV). In production Vite replaces this with false, so the branch is dead-code-eliminated — zero console noise for end users while the footgun warning still shows up during development.
·

Co-authored-by: Titux Metal <TituxMetal@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread apps/web/src/lib/storage.ts Outdated
@TituxMetal
TituxMetal merged commit 9359332 into develop Jun 25, 2026
2 checks passed
@TituxMetal
TituxMetal deleted the claude/issue-19-20260625-0310 branch June 25, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(web): document version-bump-without-migrate as destructive reset in storage helper

2 participants