[PR #4983] [MERGED] fix: remove the full-backup aggregate size ceiling #6568

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

📋 Pull Request Information

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

Base: staging ← Head: agent/backup-aggregate-overflow


📝 Commits (3)

  • 0b4043f fix: remove full backup aggregate size cap
  • 1483dba Merge remote-tracking branch 'origin/staging' into agent/backup-aggregate-overflow
  • a3d5ad9 test: harden backup regression cleanup

📊 Changes

3 files changed (+489 additions, -124 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/server/src/routes/backup.routes.ts (+414 -124)
📝 scripts/regressions/automatic-backup-retention.regression.ts (+74 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository’s staging branch or a same-repository hotfix/* branch to main.

Linked issue

Closes #4982

Why this change

  • #4978 allowed large individual media, but full backups still failed once the complete archive crossed 2 GiB. That left larger local libraries without a current automatic backup immediately before release.

What changed

  • Removed the application-level aggregate byte ceiling only for Marinara full backups.
  • Stream full backups as ZIP32 or ZIP64 as needed, including ZIP64 sizes, offsets, data descriptors, and end records.
  • Let Settings stream large backup uploads to disk and recognize only wrapped, stored-only Marinara backups for the relaxed restore policy. Generic/compressed profile ZIPs retain their existing aggregate and per-entry safeguards.
  • Carry the full-backup policy through asset validation and staging so a backup that can be written can also be restored.
  • Added forced-ZIP64 production writer/reader/import regression coverage and a changelog entry.

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

  • pnpm regression:backup
  • pnpm regression:profile-import-security
  • pnpm --filter @marinara-engine/server lint
  • pnpm check
  • Produced a real 3,011,470,061-byte automatic backup from the reported staging data set. Status finished with lastError: null and zero omissions; the 376,363,985-byte GIF remained present.
  • Parsed the resulting archive through the production Settings import reader; it classified as a full backup and returned the large GIF as a validated stream.
  • /usr/bin/unzip -t validated every member and CRC with no errors.
  • Manual release residue: create a naturally >4 GiB backup on a machine with sufficient disposable disk space. The focused regression forces the exact ZIP64 size/offset path without a 4 GiB fixture.

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)

UI evidence (if applicable)

  • Not applicable; backend backup/import fix.

Summary by CodeRabbit

  • New Features

    • Full backups can now exceed the previous 2 GiB limit.
    • Automatic and downloadable full backups use streamed ZIP64 archives for large backup sets.
    • Large full backups can be imported and restored while preserving validation for files and archive contents.
  • Bug Fixes

    • Improved handling of oversized and truncated backup uploads.
    • Added validation for malformed, split, and unsafe ZIP64 archives.
    • Existing safety limits for standard profile imports remain unchanged.

🔄 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/4983 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/13/2026 **Status:** ✅ Merged **Merged:** 8/13/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/backup-aggregate-overflow` --- ### 📝 Commits (3) - [`0b4043f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0b4043f5089a3d5dee2e9c050fb1cc2df6e60543) fix: remove full backup aggregate size cap - [`1483dba`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1483dbaf26c72566a6f580dd6f5f2dcb5baa2be4) Merge remote-tracking branch 'origin/staging' into agent/backup-aggregate-overflow - [`a3d5ad9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a3d5ad9235eaef6ce21582b1158902723b634ff7) test: harden backup regression cleanup ### 📊 Changes **3 files changed** (+489 additions, -124 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/server/src/routes/backup.routes.ts` (+414 -124) 📝 `scripts/regressions/automatic-backup-retention.regression.ts` (+74 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository’s `staging` branch or a same-repository `hotfix/*` branch to `main`. ## Linked issue Closes #4982 ## Why this change - #4978 allowed large individual media, but full backups still failed once the complete archive crossed 2 GiB. That left larger local libraries without a current automatic backup immediately before release. ## What changed - Removed the application-level aggregate byte ceiling only for Marinara full backups. - Stream full backups as ZIP32 or ZIP64 as needed, including ZIP64 sizes, offsets, data descriptors, and end records. - Let Settings stream large backup uploads to disk and recognize only wrapped, stored-only Marinara backups for the relaxed restore policy. Generic/compressed profile ZIPs retain their existing aggregate and per-entry safeguards. - Carry the full-backup policy through asset validation and staging so a backup that can be written can also be restored. - Added forced-ZIP64 production writer/reader/import regression coverage and a changelog entry. ## 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 - `pnpm regression:backup` - `pnpm regression:profile-import-security` - `pnpm --filter @marinara-engine/server lint` - `pnpm check` - Produced a real 3,011,470,061-byte automatic backup from the reported staging data set. Status finished with `lastError: null` and zero omissions; the 376,363,985-byte GIF remained present. - Parsed the resulting archive through the production Settings import reader; it classified as a full backup and returned the large GIF as a validated stream. - `/usr/bin/unzip -t` validated every member and CRC with no errors. - Manual release residue: create a naturally >4 GiB backup on a machine with sufficient disposable disk space. The focused regression forces the exact ZIP64 size/offset path without a 4 GiB fixture. ## 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) ## UI evidence (if applicable) - Not applicable; backend backup/import fix. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Full backups can now exceed the previous 2 GiB limit. * Automatic and downloadable full backups use streamed ZIP64 archives for large backup sets. * Large full backups can be imported and restored while preserving validation for files and archive contents. * **Bug Fixes** * Improved handling of oversized and truncated backup uploads. * Added validation for malformed, split, and unsafe ZIP64 archives. * Existing safety limits for standard profile imports remain unchanged. <!-- 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:11:40 +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#6568
No description provided.