Commit 6729a2d
committed
fix(recover): wrap embedded-manifest atob in try/catch for corrupt base64
atob() throws DOMException when its input isn't valid base64. The
embedded manifest lives in recover.html, which is meant to be archived
long-term; bit rot, truncated copies, or storage degradation can leave
the base64 payload unreadable. Previously the exception propagated,
leaving Step 2 asking the user to load MANIFEST.age manually — but the
whole point of embedding was to avoid needing the separate file.
Catch the decode failure and surface a toast so the user knows their
copy of recover.html is damaged and to try another copy. The i18n
function t() already falls back to English when a locale is missing
translations, so the three new keys work across all languages even
before translators catch up.
Fixes #1071 parent b29c15c commit 6729a2d
2 files changed
Lines changed: 23 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
348 | 364 | | |
349 | | - | |
350 | | - | |
351 | 365 | | |
352 | 366 | | |
353 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
0 commit comments