[GH-ISSUE #7115] Exports do nothing: the server runs out of memory on large galleries, and iPhone downloads are dropped #3976

Closed
opened 2026-10-21 06:09:13 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @SpicyMarinara on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7115

Originally assigned to: @SpicyMarinara on GitHub.

On an iPhone, exporting a character or persona (for example Marinara native) closes the menu, but no file is saved and no share or save prompt appears. Seen with Marinara hosted in Docker and opened on iOS.

Expected: the file can be saved, for example through the iOS share sheet (Save to Files) as image saves already do.

Image saves already use the share sheet on iOS. Exports for characters, personas, presets, lorebooks, connections and settings use a plain link download after fetching the file. iOS WebKit can drop that silently, especially in a Home Screen web app or on a non-HTTPS address.

Reported by the maintainer.

Originally created by @SpicyMarinara on GitHub (Oct 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7115 Originally assigned to: @SpicyMarinara on GitHub. On an iPhone, exporting a character or persona (for example **Marinara native**) closes the menu, but no file is saved and no share or save prompt appears. Seen with Marinara hosted in Docker and opened on iOS. Expected: the file can be saved, for example through the iOS share sheet (Save to Files) as image saves already do. Image saves already use the share sheet on iOS. Exports for characters, personas, presets, lorebooks, connections and settings use a plain link download after fetching the file. iOS WebKit can drop that silently, especially in a Home Screen web app or on a non-HTTPS address. Reported by the maintainer.
bsakaguchi 2026-10-21 06:09:13 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Oct 5, 2026):

Update: this happens on desktop too, and the main cause is on the server.

Marinara native export (GET /api/characters/:id/export, buildNativeCharacterEnvelope) reads the avatar, every sprite and every gallery image as a base64 data URL with Promise.all, then serializes all of it as one JSON string. For a character or persona with a large gallery, the server runs out of memory and the process dies (health shows an unclean exit, Docker restarts it). The browser gets a 502, and the client shows no error, so "nothing happens".

The fix needs to:

  • build native exports without holding every image in memory at once;
  • make import of large exports fail cleanly instead of crashing;
  • always show an error when an export fails;
  • fix the iPhone download path described above.
<!-- gh-comment-id:5997376025 --> @SpicyMarinara commented on GitHub (Oct 5, 2026): Update: this happens on desktop too, and the main cause is on the server. **Marinara native** export (`GET /api/characters/:id/export`, `buildNativeCharacterEnvelope`) reads the avatar, every sprite and **every gallery image** as a base64 data URL with `Promise.all`, then serializes all of it as one JSON string. For a character or persona with a large gallery, the server runs out of memory and the process dies (health shows an unclean exit, Docker restarts it). The browser gets a 502, and the client shows no error, so "nothing happens". The fix needs to: - build native exports without holding every image in memory at once; - make import of large exports fail cleanly instead of crashing; - always show an error when an export fails; - fix the iPhone download path described above.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 5, 2026):

Fixed on staging by #7125, with translations in #7123.

  • The server no longer crashes on big galleries. Native character and persona exports, single and bulk, stream one image at a time, so a large gallery can't run it out of memory. The exported file is unchanged, so existing imports still work.
  • Failed exports show an error instead of nothing.
  • iPhone and iPad: the share sheet opens with the file. If iOS blocks it, a "Your file is ready." message with Save file appears and stays until tapped.
  • Android app: exports now save through its file saver.
  • Known limit: importing a file still caps at 256 MB, and anything larger shows a clear error. Streaming the import is a possible follow-up.
<!-- gh-comment-id:5998836160 --> @SpicyMarinara commented on GitHub (Oct 5, 2026): Fixed on staging by #7125, with translations in #7123. - **The server no longer crashes on big galleries.** Native character and persona exports, single and bulk, stream one image at a time, so a large gallery can't run it out of memory. The exported file is unchanged, so existing imports still work. - **Failed exports show an error** instead of nothing. - **iPhone and iPad:** the share sheet opens with the file. If iOS blocks it, a "Your file is ready." message with **Save file** appears and stays until tapped. - **Android app:** exports now save through its file saver. - **Known limit:** importing a file still caps at 256 MB, and anything larger shows a clear error. Streaming the import is a possible follow-up.
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#3976
No description provided.