[PR #4762] [MERGED] feat(client): one-time localized post-migration storage notice (#4756) #6493

Closed
opened 2026-10-23 04:10:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4762
Author: @kolacheee
Created: 8/8/2026
Status: ✅ Merged
Merged: 8/8/2026
Merged by: @kolacheee

Base: staging ← Head: feat/4756-migration-notice


📝 Commits (6)

  • c7e7eff feat(client): one-time localized post-migration storage notice (#4756)
  • 2ae7383 Merge feat/4708-shard-remaining-tables (regression hygiene) into feat/4756-migration-notice
  • 57a6286 Merge staging (the merged #4708 stack) into feat/4756-migration-notice
  • 02d22b2 fix(client): authoritative client-side dismissal for the migration notice
  • 537bf80 fix(client): gate the agent prompter on the notice query, not the modal
  • fce59c9 Merge branch 'staging' into feat/4756-migration-notice

📊 Changes

9 files changed (+420 additions, -2 deletions)

View changed files

📝 packages/client/src/App.tsx (+19 -1)
➕ packages/client/src/components/modals/StorageMigrationNoticeModal.tsx (+127 -0)
➕ packages/client/src/hooks/use-storage-migration-notice.ts (+59 -0)
📝 packages/client/src/localization/locales/en.json (+14 -0)
📝 packages/server/src/db/file-backed-store.ts (+67 -1)
📝 packages/server/src/routes/app-settings.routes.ts (+2 -0)
➕ packages/shared/src/constants/storage-migration-notice.ts (+18 -0)
📝 packages/shared/src/index.ts (+1 -0)
📝 scripts/regressions/message-sharding.regression.ts (+113 -0)

📄 Description

Linked issue

Closes #4756 (maintainer-approved).

Why this change

  • The #4708 shard migration is automatic with no opt-out (by decision), but it has side effects users can see and nothing explained: chat-data disk usage roughly doubles (the .pre-shard backups are permanent by design), the familiar tables/messages.json disappears for anyone who looks at or syncs their data folder, and downgrades start being refused with a "storage format" message nobody has met before. Each of those is a predictable "is something broken?" support ticket.
  • #4756 asked for a one-time explanation in the agents-update-notification UX family, with an ELI5 default, a technical toggle, and localization per UI language.

What changed

  • Durable server-side marker — after a boot in which the store actually migrated monoliths to shards, recordMigrationNotice() persists an app_settings row (storage-migration-notice): pre-migration format (captured by the existing version gate, the only place that value exists), the migrated table list, and a timestamp. Written after load and flushed with the migrated shards, so a headless first boot cannot lose it. An unacknowledged prior notice merges (original fromFormat wins, table lists union); fresh installs migrate nothing and never write one. A future format bump that performs a real shard migration re-arms it for free.
  • Read/acknowledge with zero new routes — the key joins the app-settings allowlist; the client uses the established per-key React Query pattern. Acknowledge = PUT with an empty value.
  • StorageMigrationNoticeModal — mounted in App.tsx in the WhatsNewModal sequencing family: waits for What's New to resolve, suppresses the agent-update prompter while open, and gates on onboarding completion. ELI5 copy by default; a "Show technical details" toggle reveals the format transition (with i18next plural handling and an unknown-origin variant), the .pre-shard reclaim guidance, and the guarded-downgrade/unshard path; an "Open the storage guide" button lands the docs viewer on TROUBLESHOOTING. Dismissal is authoritative client-side (the What's New rule): a local dismissed flag plus an optimistic cache clear, with the server acknowledge best-effort — if the PUT fails, the modal stays closed for the session and the durable marker re-shows it next launch.
  • Localization — all strings are semantic keys in en.json rendered through the standard i18n layer; community locales fall back to English per repo convention (deliberately not duplicated into other locale files).
  • Regressions — marker written on migration with correct contents; acknowledged marker not resurrected by migration-free boots; fresh installs never write one; the prior-notice merge path (fromFormat precedence + table union).

The change went through the full gauntlet: recon of the four subsystems it integrates with, an adversarial review workflow (three lenses, per-finding refutation) that caught a real dismissal-reopen loop + a presentation-gate latch the initial live pass had missed (both fixed and re-verified live), and end-to-end browser verification against a real format-2 fixture — migration → marker → modal → technical toggle → dismissal (success and server-down failure paths) → reload clean → docs-viewer link.

Known accepted limitation: the storage-guide button opens the TROUBLESHOOTING document at the top rather than deep-linked to the downgrade section (the docs-viewer modal API takes a document path only).

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify on a real pre-sharding profile: upgrade, confirm the notice appears once after What's New, read both copy levels, dismiss, restart — it must not return.
  • Manually verify light + dark mode and the mobile viewport for the modal layout (my live pass ran desktop dark only).
  • Commands run: pnpm check (green, twice), message-sharding lane incl. the four marker cases (green), pnpm localization:check + key-reference regression (green). Live browser pass: migration → modal → toggle → dismissal with no reopen (1.5 s sampled) → server-down dismissal sticks (2.5 s sampled) → reload clean → guide button opens TROUBLESHOOTING.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No docs/ files changed — the new user-facing strings are UI locale keys, which ride the language-pack workflow rather than docs-i18n.

Summary by CodeRabbit

  • New Features
    • Added a one-time storage migration notice explaining format changes and affected data.
    • Users can review migration details, backup or downgrade guidance, and technical information.
    • Users can dismiss the notice or open the storage troubleshooting guide.
    • Migration information is retained across launches until acknowledged.
  • Bug Fixes
    • Improved notice timing so it appears after onboarding and other introductory flows.
  • Tests
    • Added coverage for upgrades, fresh installs, acknowledgements, and repeated migrations.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4762 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 8/8/2026 **Status:** ✅ Merged **Merged:** 8/8/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `feat/4756-migration-notice` --- ### 📝 Commits (6) - [`c7e7eff`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c7e7effd1002bd0d2ba6ab37531578835b6b118b) feat(client): one-time localized post-migration storage notice (#4756) - [`2ae7383`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2ae73838fa630d637f206b65b4c385478f3b08fe) Merge feat/4708-shard-remaining-tables (regression hygiene) into feat/4756-migration-notice - [`57a6286`](https://github.com/Pasta-Devs/Marinara-Engine/commit/57a6286b04e6cb69f112f4cbd64058dff5b6fc70) Merge staging (the merged #4708 stack) into feat/4756-migration-notice - [`02d22b2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/02d22b2a85b83ec06b545f4d98d3b1ce3b0728bb) fix(client): authoritative client-side dismissal for the migration notice - [`537bf80`](https://github.com/Pasta-Devs/Marinara-Engine/commit/537bf80b4f2ae03df2738cac230f5ecdf74ee1dd) fix(client): gate the agent prompter on the notice query, not the modal - [`fce59c9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fce59c9c2d6e2a11a8434db5489ed7271a9eccb6) Merge branch 'staging' into feat/4756-migration-notice ### 📊 Changes **9 files changed** (+420 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/App.tsx` (+19 -1) ➕ `packages/client/src/components/modals/StorageMigrationNoticeModal.tsx` (+127 -0) ➕ `packages/client/src/hooks/use-storage-migration-notice.ts` (+59 -0) 📝 `packages/client/src/localization/locales/en.json` (+14 -0) 📝 `packages/server/src/db/file-backed-store.ts` (+67 -1) 📝 `packages/server/src/routes/app-settings.routes.ts` (+2 -0) ➕ `packages/shared/src/constants/storage-migration-notice.ts` (+18 -0) 📝 `packages/shared/src/index.ts` (+1 -0) 📝 `scripts/regressions/message-sharding.regression.ts` (+113 -0) </details> ### 📄 Description ## Linked issue Closes #4756 (maintainer-approved). ## Why this change - The #4708 shard migration is automatic with no opt-out (by decision), but it has side effects users can *see* and nothing explained: chat-data disk usage roughly doubles (the `.pre-shard` backups are permanent by design), the familiar `tables/messages.json` disappears for anyone who looks at or syncs their data folder, and downgrades start being refused with a "storage format" message nobody has met before. Each of those is a predictable "is something broken?" support ticket. - #4756 asked for a one-time explanation in the agents-update-notification UX family, with an ELI5 default, a technical toggle, and localization per UI language. ## What changed - **Durable server-side marker** — after a boot in which the store actually migrated monoliths to shards, `recordMigrationNotice()` persists an `app_settings` row (`storage-migration-notice`): pre-migration format (captured by the existing version gate, the only place that value exists), the migrated table list, and a timestamp. Written after load and flushed with the migrated shards, so a headless first boot cannot lose it. An unacknowledged prior notice merges (original `fromFormat` wins, table lists union); fresh installs migrate nothing and never write one. A future format bump that performs a real shard migration re-arms it for free. - **Read/acknowledge with zero new routes** — the key joins the app-settings allowlist; the client uses the established per-key React Query pattern. Acknowledge = `PUT` with an empty value. - **`StorageMigrationNoticeModal`** — mounted in `App.tsx` in the `WhatsNewModal` sequencing family: waits for What's New to resolve, suppresses the agent-update prompter while open, and gates on onboarding completion. ELI5 copy by default; a "Show technical details" toggle reveals the format transition (with i18next plural handling and an unknown-origin variant), the `.pre-shard` reclaim guidance, and the guarded-downgrade/`unshard` path; an "Open the storage guide" button lands the docs viewer on TROUBLESHOOTING. **Dismissal is authoritative client-side** (the What's New rule): a local dismissed flag plus an optimistic cache clear, with the server acknowledge best-effort — if the PUT fails, the modal stays closed for the session and the durable marker re-shows it next launch. - **Localization** — all strings are semantic keys in `en.json` rendered through the standard i18n layer; community locales fall back to English per repo convention (deliberately not duplicated into other locale files). - **Regressions** — marker written on migration with correct contents; acknowledged marker not resurrected by migration-free boots; fresh installs never write one; the prior-notice merge path (fromFormat precedence + table union). The change went through the full gauntlet: recon of the four subsystems it integrates with, an adversarial review workflow (three lenses, per-finding refutation) that caught a real dismissal-reopen loop + a presentation-gate latch the initial live pass had missed (both fixed and re-verified live), and end-to-end browser verification against a real format-2 fixture — migration → marker → modal → technical toggle → dismissal (success *and* server-down failure paths) → reload clean → docs-viewer link. Known accepted limitation: the storage-guide button opens the TROUBLESHOOTING document at the top rather than deep-linked to the downgrade section (the docs-viewer modal API takes a document path only). ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify on a real pre-sharding profile: upgrade, confirm the notice appears once after What's New, read both copy levels, dismiss, restart — it must not return. - Manually verify light + dark mode and the mobile viewport for the modal layout (my live pass ran desktop dark only). - Commands run: `pnpm check` (green, twice), message-sharding lane incl. the four marker cases (green), `pnpm localization:check` + key-reference regression (green). Live browser pass: migration → modal → toggle → dismissal with no reopen (1.5 s sampled) → server-down dismissal sticks (2.5 s sampled) → reload clean → guide button opens TROUBLESHOOTING. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No `docs/` files changed — the new user-facing strings are UI locale keys, which ride the language-pack workflow rather than docs-i18n. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a one-time storage migration notice explaining format changes and affected data. * Users can review migration details, backup or downgrade guidance, and technical information. * Users can dismiss the notice or open the storage troubleshooting guide. * Migration information is retained across launches until acknowledged. * **Bug Fixes** * Improved notice timing so it appears after onboarding and other introductory flows. * **Tests** * Added coverage for upgrades, fresh installs, acknowledgements, and repeated migrations. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:10:56 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6493
No description provided.