From 5b34d1bacc4a9d9d30b26b5bf89845ceb51fc100 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 18 Oct 2026 23:02:12 -0700 Subject: migrate: retry smaller on a shortfall in any language MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The debit error is localized ("Unzureichende Mittel ⚡️20582 / 20600"), so the English-only regex skipped the held-back retry for non-English accounts. Also match the error's language-neutral ⚡️available / needed tail. Co-Authored-By: Claude Opus 5.5 --- src/routes/(app)/migrate/+page.server.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/routes/(app)/migrate/+page.server.ts b/src/routes/(app)/migrate/+page.server.ts index 48ae6a96..6559485f 100644 --- a/src/routes/(app)/migrate/+page.server.ts +++ b/src/routes/(app)/migrate/+page.server.ts @@ -81,8 +81,11 @@ export const actions = { } catch (e) { lastErr = e; const msg = String((e as any)?.message || e); - // only a shortfall is worth retrying smaller - if (!/insufficient|balance|not enough|fee/i.test(msg)) throw e; + // only a shortfall is worth retrying smaller. The server's debit + // error is in the user's language ("Unzureichende Mittel ⚡️20582 / + // 20600"), so match its numeric tail rather than just the words. + if (!/insufficient|balance|not enough|fee|⚡\uFE0F?\s*\d+\s*(\/|of)\s*⚡?\uFE0F?\s*\d+/i.test(msg)) + throw e; } } if (!sent) throw lastErr; -- cgit v1.2.3