[PR #1019] [MERGED] Fix profile export fallback for large assets #4888

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1019
Author: @Xelvanis
Created: 5/19/2026
Status: ✅ Merged
Merged: 5/20/2026
Merged by: @Xelvanis

Base: staging ← Head: fix/profile-export-large-assets


📝 Commits (2)

  • 4a46c14 Fix profile export large asset fallback
  • 85acb14 Address profile import review findings

📊 Changes

3 files changed (+1619 additions, -440 deletions)

View changed files

📝 packages/client/src/components/panels/SettingsPanel.tsx (+205 -43)
📝 packages/client/src/components/ui/ExportFormatDialog.tsx (+2 -1)
📝 packages/server/src/routes/backup.routes.ts (+1412 -396)

📄 Description

Linked issue

No linked issue yet. This bug came from local profile export investigation; an issue should be opened or linked before this draft leaves WIP.

Why this change

Large avatar/sprite assets could make native profile export build one huge JSON response. Older or heavier installs could fail when the app tried to stringify/send that data, leaving users without a reliable profile export path.

What changed

  • Kept the default profile export as the existing compact JSON format for normal profiles.
  • Added oversized JSON detection that tells the client to offer ZIP export as a fallback.
  • Added profile ZIP export/import support for profile assets and full backup ZIP imports.
  • Streamed profile ZIP export through a temp archive instead of buffering the whole ZIP response.
  • Made ZIP import validate sizes, avoid loading the whole uploaded archive at once, reject truncated uploads, and warn instead of failing when asset files are missing from an otherwise importable ZIP.
  • Updated Settings import/export UI for ZIP fallback, ZIP import, and missing-asset warnings.

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

Automated validation performed:

  • pnpm --dir packages/server exec tsx ../../.codex-scratchpads/profile-export-large-assets-repro.ts
  • pnpm check
  • git diff --check

Manual verification notes

  • Synced to the TEST folder for manual app testing.
  • Manual click-through still pending.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Pending manual TEST verification.

Summary by CodeRabbit

Release Notes

  • New Features

    • Profile import now accepts both JSON and ZIP file formats with real-time progress tracking
    • Profile export supports multiple output formats with automatic ZIP fallback when JSON files exceed size limits
    • Import warnings are displayed with amber status indicator and detailed warning summary
  • Improvements

    • Enhanced export format selection dialog
    • Updated UI labels and descriptions for profile import/export functionality

Review Change Stack


🔄 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/1019 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/19/2026 **Status:** ✅ Merged **Merged:** 5/20/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `staging` ← **Head:** `fix/profile-export-large-assets` --- ### 📝 Commits (2) - [`4a46c14`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4a46c1462255ce7a6feb7865bf6e358136713c13) Fix profile export large asset fallback - [`85acb14`](https://github.com/Pasta-Devs/Marinara-Engine/commit/85acb1460e4c0282d199aef87235d14249071513) Address profile import review findings ### 📊 Changes **3 files changed** (+1619 additions, -440 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+205 -43) 📝 `packages/client/src/components/ui/ExportFormatDialog.tsx` (+2 -1) 📝 `packages/server/src/routes/backup.routes.ts` (+1412 -396) </details> ### 📄 Description ## Linked issue No linked issue yet. This bug came from local profile export investigation; an issue should be opened or linked before this draft leaves WIP. ## Why this change Large avatar/sprite assets could make native profile export build one huge JSON response. Older or heavier installs could fail when the app tried to stringify/send that data, leaving users without a reliable profile export path. ## What changed - Kept the default profile export as the existing compact JSON format for normal profiles. - Added oversized JSON detection that tells the client to offer ZIP export as a fallback. - Added profile ZIP export/import support for profile assets and full backup ZIP imports. - Streamed profile ZIP export through a temp archive instead of buffering the whole ZIP response. - Made ZIP import validate sizes, avoid loading the whole uploaded archive at once, reject truncated uploads, and warn instead of failing when asset files are missing from an otherwise importable ZIP. - Updated Settings import/export UI for ZIP fallback, ZIP import, and missing-asset warnings. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` Automated validation performed: - `pnpm --dir packages/server exec tsx ../../.codex-scratchpads/profile-export-large-assets-repro.ts` - `pnpm check` - `git diff --check` ### Manual verification notes - Synced to the TEST folder for manual app testing. - Manual click-through still pending. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Pending manual TEST verification. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Profile import now accepts both JSON and ZIP file formats with real-time progress tracking * Profile export supports multiple output formats with automatic ZIP fallback when JSON files exceed size limits * Import warnings are displayed with amber status indicator and detailed warning summary * **Improvements** * Enhanced export format selection dialog * Updated UI labels and descriptions for profile import/export functionality <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1019?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- 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-22 04:11:28 +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#4888
No description provided.