[GH-ISSUE #1993] [Issue]: Authorized remote managed asset blob URLs need consistent invalidation #977

Closed
opened 2026-10-21 05:24:34 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @Promansis on GitHub.

Summary

Authorized remote managed assets are fetched into blob URLs and cached in memory, but invalidation appears broad and uneven across asset kinds. This can leave remote runtime sessions with stale images or retained object URLs after gallery, background, lorebook, avatar, or sprite mutations.

Expected behavior

Remote managed asset object URLs should be invalidated consistently for every mutation that can change the served bytes, and cache keys should include enough freshness information to avoid stale image delivery.

Actual behavior

Static audit found:

  • src/shared/api/local-file-api.ts creates object URLs for authorized remote managed assets and caches them by base URL, authorization, and asset URL.
  • invalidateRemoteManagedAssetObjectUrls exists and can revoke cached object URLs.
  • Explicit mutation invalidation was found for game assets in src/shared/api/assets-api.ts.
  • Comparable invalidation was not found during the audit for gallery, background, lorebook, avatar, or sprite image mutations.

This issue does not claim a measured memory leak or stale image repro yet; it tracks the cache/freshness risk found by source inspection.

Steps to reproduce

  1. Run Marinara through the remote runtime with authorization enabled.
  2. Display managed images such as gallery, background, lorebook, avatar, or sprite assets.
  3. Mutate or replace those assets through the app.
  4. Revisit the same surface and check whether the old blob URL remains cached or whether stale bytes are shown.

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
  • Run mode: remote runtime with authorization
  • OS + version: not confirmed
  • Node + pnpm versions: not confirmed
  • Rust version, if relevant: not confirmed
  • Remote Runtime URL configured? yes, for repro
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

No browser/network proof yet. Static source evidence:

  • Object URL cache creation: src/shared/api/local-file-api.ts
  • Cache invalidation function: src/shared/api/local-file-api.ts
  • Game asset mutation invalidation: src/shared/api/assets-api.ts

Regression notes

Not confirmed as a regression. This is a remote-runtime parity and freshness risk found during image delivery audit.

Additional context

Possible fix directions:

  • Add mutation-scoped invalidation for gallery, background, lorebook, avatar, and sprite asset writes/deletes/renames.
  • Include version/freshness keys for mutable managed asset URLs where appropriate.
  • Add browser/network proof for authorized remote runtime before and after: object URL count, cache invalidation behavior, response headers, and displayed image freshness.

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 @Promansis on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1993 Originally assigned to: @Promansis on GitHub. ## Summary Authorized remote managed assets are fetched into blob URLs and cached in memory, but invalidation appears broad and uneven across asset kinds. This can leave remote runtime sessions with stale images or retained object URLs after gallery, background, lorebook, avatar, or sprite mutations. ## Expected behavior Remote managed asset object URLs should be invalidated consistently for every mutation that can change the served bytes, and cache keys should include enough freshness information to avoid stale image delivery. ## Actual behavior Static audit found: - `src/shared/api/local-file-api.ts` creates object URLs for authorized remote managed assets and caches them by base URL, authorization, and asset URL. - `invalidateRemoteManagedAssetObjectUrls` exists and can revoke cached object URLs. - Explicit mutation invalidation was found for game assets in `src/shared/api/assets-api.ts`. - Comparable invalidation was not found during the audit for gallery, background, lorebook, avatar, or sprite image mutations. This issue does not claim a measured memory leak or stale image repro yet; it tracks the cache/freshness risk found by source inspection. ## Steps to reproduce 1. Run Marinara through the remote runtime with authorization enabled. 2. Display managed images such as gallery, background, lorebook, avatar, or sprite assets. 3. Mutate or replace those assets through the app. 4. Revisit the same surface and check whether the old blob URL remains cached or whether stale bytes are shown. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [x] Chat mode - [x] Roleplay mode - [x] Game mode - [x] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [x] 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` - Run mode: remote runtime with authorization - OS + version: not confirmed - Node + pnpm versions: not confirmed - Rust version, if relevant: not confirmed - Remote Runtime URL configured? yes, for repro - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video No browser/network proof yet. Static source evidence: - Object URL cache creation: `src/shared/api/local-file-api.ts` - Cache invalidation function: `src/shared/api/local-file-api.ts` - Game asset mutation invalidation: `src/shared/api/assets-api.ts` ## Regression notes Not confirmed as a regression. This is a remote-runtime parity and freshness risk found during image delivery audit. ## Additional context Possible fix directions: - Add mutation-scoped invalidation for gallery, background, lorebook, avatar, and sprite asset writes/deletes/renames. - Include version/freshness keys for mutable managed asset URLs where appropriate. - Add browser/network proof for authorized remote runtime before and after: object URL count, cache invalidation behavior, response headers, and displayed image freshness. ## 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:24:34 +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#977
No description provided.