mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4441] Backup and profile export fail for users with large data directories (>1 GB assets) #2410
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#2410
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 (Aug 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4441
Originally assigned to: @SpicyMarinara on GitHub.
Users with large data directories (one reported ~25 GB) cannot back up or export their data through any of the available paths. Both the "Download Backup" button and the "Export Profile" option fail with size-related errors.
What happens
Export Profile (Settings → Backup & Export → Export Profile):
PROFILE_IMPORT_BODY_LIMIT_BYTESatbackup.routes.ts:82) almost immediately and returns HTTP 413 withPROFILE_EXPORT_JSON_TOO_LARGE.ProfileArchiveTooLargeErrorwhen they exceed 1 GiB (PROFILE_ARCHIVE_TOTAL_UNCOMPRESSED_LIMIT_BYTESatbackup.routes.ts:86, enforced at line 1117). The user sees "Profile ZIP export is too large" with no further fallback.Download Backup (Settings → Backup & Export → Download Backup):
The server builds a single ZIP archive containing the profile tables (no inline assets) plus every file from all 17
BACKUP_DIRSdirectories. The custom ZIP writer uses 32-bit offsets only (assertZip32Valueatbackup.routes.ts:1394), so the total archive cannot exceed ~4 GiB. A 25 GB data directory blows past this immediately. Additionally, even if the server produced the archive, the client loads the entire response into a singleBlobviaawait res.blob()(SettingsPanel.tsx:6874), which would OOM the browser tab for multi-GB archives.Create Backup (on-disk folder backup):
Calls
writeNativeProfileZip()(backup.routes.ts:2397) withincludeAssets: true, which hits the same 1 GiB asset limit as the profile ZIP export path above. The directory copies at lines 2403-2408 never run because the profile ZIP creation throws first.Automatic Backup:
Calls
writeFullBackupArchive(), which hits the same ZIP32 ~4 GiB limit as the download path.Net result: every backup and export path is blocked for users with >1 GiB of asset data. The only escape hatch is manually exporting individual character cards.
Try it yourself
Have a data directory with >1 GiB of assets across avatars, sprites, backgrounds, gallery, game-assets, etc. (a gallery with a few hundred images gets there quickly). Then:
Where the limits live
PROFILE_IMPORT_BODY_LIMIT_BYTESbackup.routes.ts:82PROFILE_ARCHIVE_TOTAL_UNCOMPRESSED_LIMIT_BYTESbackup.routes.ts:86ZIP32_MAX_VALUEbackup.routes.ts:91res.blob()SettingsPanel.tsx:6874Possible directions
POST /backup): skip the embedded profile ZIP for assets and just copy the raw directories (which it already does at lines 2403-2408). The profile ZIP should only contain the database tables/manifest. This removes the 1 GiB bottleneck for on-disk backups with zero format changes.POST /backup/download): switch from ZIP32 to ZIP64 (or stream a tar), and change the client fromres.blob()to a streamed download (theshowSaveFilePickerpath atSettingsPanel.tsx:6885already has a writable stream — pipe to it chunk-by-chunk instead of buffering the full blob).