[PR #1243] [CLOSED] Fix: Limit bulk import cache invalidation [Issue: 1162] #4999

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1243
Author: @Promansis
Created: 5/26/2026
Status: ❌ Closed

Base: refactor ← Head: fix/issue-1162-character-cache-churn


📝 Commits (1)

  • e29d42a Limit bulk import cache invalidation

📊 Changes

1 file changed (+27 additions, -1 deletions)

View changed files

📝 src/features/shell/imports/components/STBulkImportModal.tsx (+27 -1)

📄 Description

Linked issue

Closes #1162

Why this change

  • Bulk SillyTavern import refreshed every React Query cache after a successful import, even when only one catalog changed. That made character import/delete cache behavior noisier than needed and could trigger unrelated storage refetches.

What changed

  • Replaced the unkeyed bulk import invalidateQueries() call with targeted invalidations based on the import result counts.
  • Refreshes only the affected catalog query families: characters, chats, lorebooks, presets, personas, and backgrounds/background tags.

Refactor impact

Primary owner:

imports UI (src/features/shell/imports)

Impact areas reviewed:

  • Character catalog cache helpers for single import/delete already use narrow list cache updates where the API returns row data.
  • Bulk ST import Rust result returns category counts rather than imported row records, so direct setQueryData is not currently available for that flow.
  • Catalog query keys for characters, chats, lorebooks, presets, personas, and settings backgrounds.

Boundary notes:

  • Feature-only cache invalidation change.
  • No engine, shared API transport, Rust command, storage contract, or remote-runtime boundary changes.

Pressure points touched:

  • STBulkImportModal successful import completion path.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Not manually exercised in the app. Verified the PR branch with pnpm typecheck, pnpm check:architecture, and git diff --check.

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 changes.


🔄 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/1243 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 5/26/2026 **Status:** ❌ Closed **Base:** `refactor` ← **Head:** `fix/issue-1162-character-cache-churn` --- ### 📝 Commits (1) - [`e29d42a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e29d42af6909e2b3af128d2a383332eda9023525) Limit bulk import cache invalidation ### 📊 Changes **1 file changed** (+27 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/features/shell/imports/components/STBulkImportModal.tsx` (+27 -1) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1162 ## Why this change - Bulk SillyTavern import refreshed every React Query cache after a successful import, even when only one catalog changed. That made character import/delete cache behavior noisier than needed and could trigger unrelated storage refetches. ## What changed - Replaced the unkeyed bulk import `invalidateQueries()` call with targeted invalidations based on the import result counts. - Refreshes only the affected catalog query families: characters, chats, lorebooks, presets, personas, and backgrounds/background tags. ## Refactor impact Primary owner: imports UI (`src/features/shell/imports`) Impact areas reviewed: - Character catalog cache helpers for single import/delete already use narrow list cache updates where the API returns row data. - Bulk ST import Rust result returns category counts rather than imported row records, so direct `setQueryData` is not currently available for that flow. - Catalog query keys for characters, chats, lorebooks, presets, personas, and settings backgrounds. Boundary notes: - Feature-only cache invalidation change. - No engine, shared API transport, Rust command, storage contract, or remote-runtime boundary changes. Pressure points touched: - `STBulkImportModal` successful import completion path. ## Validation - [x] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [x] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [x] Rust clippy/tests were run for Rust behavior changes - [x] Browser or Tauri app manual verification completed - [x] Playwright, screenshot, or recording evidence added for UI changes - [x] Remote runtime smoke checked when relevant ### Manual verification notes - Not manually exercised in the app. Verified the PR branch with `pnpm typecheck`, `pnpm check:architecture`, and `git diff --check`. ## 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 changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:21 +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#4999
No description provided.