[PR #1997] [MERGED] Fix remote managed asset invalidation #5382

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1997
Author: @Promansis
Created: 6/3/2026
Status: ✅ Merged
Merged: 6/3/2026
Merged by: @Promansis

Base: refactor ← Head: issue-1993-remote-managed-asset-invalidation


📝 Commits (2)

  • 8c5effe Fix remote managed asset invalidation
  • d7c540b Fix streamed import invalidation on generator close

📊 Changes

11 files changed (+348 additions, -88 deletions)

View changed files

📝 src/shared/api/assets-api.ts (+16 -16)
📝 src/shared/api/avatar-api.ts (+8 -4)
📝 src/shared/api/character-api.ts (+17 -3)
📝 src/shared/api/image-generation-api.ts (+26 -8)
📝 src/shared/api/import-api.ts (+91 -13)
📝 src/shared/api/local-file-api.ts (+81 -19)
📝 src/shared/api/lorebook-command-api.ts (+5 -1)
📝 src/shared/api/persona-api.ts (+5 -1)
📝 src/shared/api/profile-api.ts (+26 -6)
📝 src/shared/api/settings-assets-api.ts (+9 -3)
📝 src/shared/api/storage-api.ts (+64 -14)

📄 Description

Linked issue

Closes #1993

Why this change

  • Remote managed asset URLs could stay stale after uploads, imports, deletes, restores, and storage writes because the existing invalidation only revoked authenticated blob object URLs. Unauthenticated remote runtime asset URLs still used stable /api/assets/... paths that the HTTP server can cache for mutable asset kinds.

What changed

  • Added shared remote managed asset invalidation versions that append a cache-busting query to future managed asset URLs after kind, path, or global invalidation.
  • Added a shared invalidateRemoteManagedAssetObjectUrlsAfter wrapper and applied it to asset-mutating shared API calls for avatars, backgrounds, galleries, sprites, game assets, lorebook images, imports, profile imports, and generic storage writes/deletes.
  • Preserved existing sprite cache-key query behavior while merging the new invalidation query.

Refactor impact

Primary owner:

shared API / remote runtime managed asset URL resolution

Impact areas reviewed:

  • Remote managed asset URL generation for avatar, avatar-thumbnail, background, gallery, game, lorebook, and sprite assets.
  • Shared API wrappers for asset mutation, imports, profile import, and storage writes/deletes.
  • Remote runtime dispatch boundary, Tauri command wrapper, and HTTP managed asset cache headers.

Boundary notes:

  • Behavior stays in src/shared/api runtime wrappers and URL resolution.
  • No engine, React feature, or Rust ownership boundary was moved.
  • Hostable HTTP command routing remains explicit; this only changes client-side invalidation/cache-busting behavior.

Pressure points touched:

  • src/shared/api/local-file-api.ts
  • Shared API mutation wrappers for assets/imports/profile/storage.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • git diff --check passed.
  • pnpm typecheck passed.
  • pnpm check:architecture passed.
  • Temporary scratch Vitest proof passed: raw unauthenticated remote asset URLs change after kind invalidation, existing sprite v= query is preserved, and path invalidation leaves a neighboring path unchanged. The scratch test file was deleted before commit.
  • pnpm check passed.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Internal remote managed asset cache invalidation bugfix; no new user-discoverable feature, workflow, setting, mode, panel, import path, or advanced tool.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

No visible UI layout change; no screenshots required.


🔄 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/1997 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `issue-1993-remote-managed-asset-invalidation` --- ### 📝 Commits (2) - [`8c5effe`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8c5effe0068df4382c58ff230adec25fbb1d46c5) Fix remote managed asset invalidation - [`d7c540b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d7c540b396bc5d0ad492b25fff0a56c2663c19c1) Fix streamed import invalidation on generator close ### 📊 Changes **11 files changed** (+348 additions, -88 deletions) <details> <summary>View changed files</summary> 📝 `src/shared/api/assets-api.ts` (+16 -16) 📝 `src/shared/api/avatar-api.ts` (+8 -4) 📝 `src/shared/api/character-api.ts` (+17 -3) 📝 `src/shared/api/image-generation-api.ts` (+26 -8) 📝 `src/shared/api/import-api.ts` (+91 -13) 📝 `src/shared/api/local-file-api.ts` (+81 -19) 📝 `src/shared/api/lorebook-command-api.ts` (+5 -1) 📝 `src/shared/api/persona-api.ts` (+5 -1) 📝 `src/shared/api/profile-api.ts` (+26 -6) 📝 `src/shared/api/settings-assets-api.ts` (+9 -3) 📝 `src/shared/api/storage-api.ts` (+64 -14) </details> ### 📄 Description ## Linked issue Closes #1993 ## Why this change - Remote managed asset URLs could stay stale after uploads, imports, deletes, restores, and storage writes because the existing invalidation only revoked authenticated blob object URLs. Unauthenticated remote runtime asset URLs still used stable `/api/assets/...` paths that the HTTP server can cache for mutable asset kinds. ## What changed - Added shared remote managed asset invalidation versions that append a cache-busting query to future managed asset URLs after kind, path, or global invalidation. - Added a shared `invalidateRemoteManagedAssetObjectUrlsAfter` wrapper and applied it to asset-mutating shared API calls for avatars, backgrounds, galleries, sprites, game assets, lorebook images, imports, profile imports, and generic storage writes/deletes. - Preserved existing sprite cache-key query behavior while merging the new invalidation query. ## Refactor impact Primary owner: shared API / remote runtime managed asset URL resolution Impact areas reviewed: - Remote managed asset URL generation for avatar, avatar-thumbnail, background, gallery, game, lorebook, and sprite assets. - Shared API wrappers for asset mutation, imports, profile import, and storage writes/deletes. - Remote runtime dispatch boundary, Tauri command wrapper, and HTTP managed asset cache headers. Boundary notes: - Behavior stays in `src/shared/api` runtime wrappers and URL resolution. - No engine, React feature, or Rust ownership boundary was moved. - Hostable HTTP command routing remains explicit; this only changes client-side invalidation/cache-busting behavior. Pressure points touched: - `src/shared/api/local-file-api.ts` - Shared API mutation wrappers for assets/imports/profile/storage. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `git diff --check` passed. - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - Temporary scratch Vitest proof passed: raw unauthenticated remote asset URLs change after kind invalidation, existing sprite `v=` query is preserved, and path invalidation leaves a neighboring path unchanged. The scratch test file was deleted before commit. - `pnpm check` passed. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Internal remote managed asset cache invalidation bugfix; no new user-discoverable feature, workflow, setting, mode, panel, import path, or advanced tool. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence No visible UI layout change; no screenshots required. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:48 +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#5382
No description provided.