[GH-ISSUE #1929] Restore startup recovery for gallery files without storage records #946

Closed
opened 2026-10-21 05:23:56 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Xelvanis on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1929

Originally assigned to: @cha1latte on GitHub.

Summary

Legacy recovered orphaned gallery files from disk on startup when the files existed but the database/storage row was missing. Refactor does not appear to have an equivalent recovery path for gallery media.

Expected behavior

If gallery media is stored as files, startup or repair tooling should be able to restore missing gallery storage records for valid files that still belong to existing chats/resources.

Actual behavior

Legacy called recoverGalleryImages(db) during server startup and scanned data/gallery. Refactor searches did not find an equivalent gallery recovery path. Current refactor gallery storage is also mostly inline data URLs, which masks the missing file recovery until gallery media becomes managed-file backed again.

Evidence:

  • Legacy startup calls recovery at packages/server/src/app.ts:107.
  • Legacy recovery implementation starts at packages/server/src/services/storage/gallery-recovery.ts:19.
  • Refactor gallery upload currently stores data URLs at src-tauri/src/commands/storage/shared.rs:2251, so there is no comparable file-backed recovery flow.

Steps to reproduce

  1. Use a build with file-backed gallery media.
  2. Leave a valid gallery image file on disk while its storage record is missing.
  3. Start the app.
  4. Observe whether the gallery row is restored. Legacy restored these rows; refactor has no matching implementation found in the audit.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor-line audit at 8c36be60
  • Run mode: Static code audit; relevant after gallery media is file-backed
  • OS + version: Not relevant
  • Node + pnpm versions: Not relevant
  • Rust version, if relevant: Not relevant
  • Remote Runtime URL configured? Not directly relevant
  • Provider, model, or integration, if relevant: Gallery media storage

Logs, screenshots, or video

No runtime logs or screenshots. Static parity evidence only.

Regression notes

Legacy restored orphaned gallery images into DB rows during startup. Refactor did not show an equivalent recovery path during the media/assets parity scan.

Additional context

This came from parity target 4, media and assets, under #1904. This likely pairs with the managed-gallery issue: once gallery media is restored to file-backed storage, recovery/repair should be restored too.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Jun 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1929 Originally assigned to: @cha1latte on GitHub. ## Summary Legacy recovered orphaned gallery files from disk on startup when the files existed but the database/storage row was missing. Refactor does not appear to have an equivalent recovery path for gallery media. ## Expected behavior If gallery media is stored as files, startup or repair tooling should be able to restore missing gallery storage records for valid files that still belong to existing chats/resources. ## Actual behavior Legacy called `recoverGalleryImages(db)` during server startup and scanned `data/gallery`. Refactor searches did not find an equivalent gallery recovery path. Current refactor gallery storage is also mostly inline data URLs, which masks the missing file recovery until gallery media becomes managed-file backed again. Evidence: - Legacy startup calls recovery at `packages/server/src/app.ts:107`. - Legacy recovery implementation starts at `packages/server/src/services/storage/gallery-recovery.ts:19`. - Refactor gallery upload currently stores data URLs at `src-tauri/src/commands/storage/shared.rs:2251`, so there is no comparable file-backed recovery flow. ## Steps to reproduce 1. Use a build with file-backed gallery media. 2. Leave a valid gallery image file on disk while its storage record is missing. 3. Start the app. 4. Observe whether the gallery row is restored. Legacy restored these rows; refactor has no matching implementation found in the audit. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [x] Chat mode - [ ] Roleplay mode - [x] Game mode - [x] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: refactor-line audit at `8c36be60` - Run mode: Static code audit; relevant after gallery media is file-backed - OS + version: Not relevant - Node + pnpm versions: Not relevant - Rust version, if relevant: Not relevant - Remote Runtime URL configured? Not directly relevant - Provider, model, or integration, if relevant: Gallery media storage ## Logs, screenshots, or video No runtime logs or screenshots. Static parity evidence only. ## Regression notes Legacy restored orphaned gallery images into DB rows during startup. Refactor did not show an equivalent recovery path during the media/assets parity scan. ## Additional context This came from parity target 4, media and assets, under #1904. This likely pairs with the managed-gallery issue: once gallery media is restored to file-backed storage, recovery/repair should be restored too. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:23:56 +07:00
Author
Owner

@cha1latte commented on GitHub (Jun 2, 2026):

fixed in #1953

<!-- gh-comment-id:4604376798 --> @cha1latte commented on GitHub (Jun 2, 2026): fixed in #1953
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#946
No description provided.