mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2954] [Issue]: Legacy theme migration retries forever (and silently) if one theme can't be saved #1532
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1532
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Jun 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2954
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
The one-time migration that copies old localStorage themes onto the server POSTs each theme in a loop and only marks itself done if the whole loop succeeds. Its catch block swallows all errors silently (no toast, no log) and leaves the "migrated" flag unset — so if any single theme is persistently rejected by the server (e.g. a 400 from an invalid field), the whole migration re-runs its redundant
GET+ re-POSTburst on every app start, forever. Deduplication prevents duplicate rows, so the symptom is a recurring pointless request burst rather than corruption — but it never stops on its own and gives no diagnostic. (The extension migration, by contrast, has a 429 backoff helper and at least logs.)How to reproduce (try it yourself)
localStoragewith a legacy theme the server will reject — e.g. acustomThemesentry whosenameis an empty string (the create schema requires a non-empty name) — and sethasMigratedCustomThemesToServertofalse.You'll see (Network tab): the full
GET /themes+POST /themesburst repeats on every reload, with no toast or console warning, and the migrated flag never flips.Expected: the migration backs off on transient errors and, on a permanent error, gives up (marks itself migrated, or surfaces a toast) instead of looping every boot.
Where it is
packages/client/src/hooks/use-themes.ts—useLegacyThemeMigration, lines 80-121: a directapi.postat line 96 (no backoff), a redundantapi.getat 88, the flag set only after the full loop succeeds at 114, and a barecatch {}at 116 that swallows everything. Contrastuse-extensions.tspostExtensionWithBackoff(lines 29-44), which retries on 429 and logs.What's happening
No backoff was added for theme POSTs, and the catch leaves the flag unset on all errors (not just transient ones), so one un-postable theme traps the migration in an every-boot retry that can never complete.
Suggested fix
Mirror
postExtensionWithBackofffor theme POSTs, distinguish transient (429/5xx → retry) from permanent (4xx → give up: mark migrated or surface a toast), and at least log on failure so a stuck migration is diagnosable.AI-investigated against v2.0.6; cited lines read. Please confirm before fixing.
@SpicyMarinara commented on GitHub (Jun 28, 2026):
Fixed on staging: legacy theme migration now uses bounded retry/backoff for transient errors, skips permanent rejected entries with diagnostics, and marks migration complete once recoverable work is done.