[PR #1718] [MERGED] Fix persona import cache refresh #5230

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1718
Author: @Xelvanis
Created: 5/31/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @Xelvanis

Base: refactor ← Head: bugfix/persona-import-refresh-gap


📝 Commits (1)

  • 8e13384 Fix persona import cache refresh

📊 Changes

4 files changed (+31 additions, -17 deletions)

View changed files

📝 src/features/catalog/personas/components/ImportPersonaModal.tsx (+2 -2)
📝 src/features/catalog/personas/hooks/use-personas.test.tsx (+15 -0)
📝 src/features/catalog/personas/hooks/use-personas.ts (+12 -13)
📝 src/features/shell/imports/components/STBulkImportModal.tsx (+2 -2)

📄 Description

Linked issue

None.

Why this change

Persona import refresh relied on personaKeys.list also matching summary queries by prefix. That worked with current React Query matching, but it made import refresh behavior easy to regress or misread after the refactor split full persona reads from summary reads.

What changed

  • Added invalidatePersonaCollectionQueries() to invalidate full persona lists and persona summaries explicitly.
  • Switched direct persona import and SillyTavern bulk persona import to use the shared invalidation helper.
  • Added a focused regression test proving the helper invalidates list and summary caches without broad invalidation of detail or active-persona caches.

Refactor impact

Primary owner:

Catalog personas.

Impact areas reviewed:

  • Direct persona import modal.
  • SillyTavern bulk import modal.
  • Persona panel summary query cache.
  • Existing persona create/update/delete/duplicate/activate/avatar mutation cache refresh.

Boundary notes:

No engine, shared API, Rust, or remote-runtime contract changes. Change stays in React feature/cache ownership.

Pressure points touched:

Import modal surfaces only; no broad mode surfaces or Tauri command registration touched.

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

Automated validation run by Codex:

  • pnpm vitest run src/features/catalog/personas/hooks/use-personas.test.tsx
  • pnpm typecheck
  • pnpm check:architecture
  • git diff --check origin/refactor...HEAD
  • Local React Query refetch probe confirmed list and summaries each refetch once after exact invalidation.

No native Tauri manual QA was run; this is a React Query cache-refresh-only change.

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

No docs or release-note updates made; behavior change is internal cache refresh.

UI evidence

Not applicable; no visible layout change.

Summary by CodeRabbit

  • Refactor
    • Streamlined internal cache management for persona imports and bulk import operations to improve code maintainability and reliability.

🔄 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/1718 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/31/2026 **Status:** ✅ Merged **Merged:** 5/31/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `bugfix/persona-import-refresh-gap` --- ### 📝 Commits (1) - [`8e13384`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8e13384a7d77d3353ce71ff27b7524ccb4417959) Fix persona import cache refresh ### 📊 Changes **4 files changed** (+31 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src/features/catalog/personas/components/ImportPersonaModal.tsx` (+2 -2) 📝 `src/features/catalog/personas/hooks/use-personas.test.tsx` (+15 -0) 📝 `src/features/catalog/personas/hooks/use-personas.ts` (+12 -13) 📝 `src/features/shell/imports/components/STBulkImportModal.tsx` (+2 -2) </details> ### 📄 Description ## Linked issue None. ## Why this change Persona import refresh relied on `personaKeys.list` also matching summary queries by prefix. That worked with current React Query matching, but it made import refresh behavior easy to regress or misread after the refactor split full persona reads from summary reads. ## What changed - Added `invalidatePersonaCollectionQueries()` to invalidate full persona lists and persona summaries explicitly. - Switched direct persona import and SillyTavern bulk persona import to use the shared invalidation helper. - Added a focused regression test proving the helper invalidates list and summary caches without broad invalidation of detail or active-persona caches. ## Refactor impact Primary owner: Catalog personas. Impact areas reviewed: - Direct persona import modal. - SillyTavern bulk import modal. - Persona panel summary query cache. - Existing persona create/update/delete/duplicate/activate/avatar mutation cache refresh. Boundary notes: No engine, shared API, Rust, or remote-runtime contract changes. Change stays in React feature/cache ownership. Pressure points touched: Import modal surfaces only; no broad mode surfaces or Tauri command registration touched. ## 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 Automated validation run by Codex: - `pnpm vitest run src/features/catalog/personas/hooks/use-personas.test.tsx` - `pnpm typecheck` - `pnpm check:architecture` - `git diff --check origin/refactor...HEAD` - Local React Query refetch probe confirmed list and summaries each refetch once after exact invalidation. No native Tauri manual QA was run; this is a React Query cache-refresh-only change. ## 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 No docs or release-note updates made; behavior change is internal cache refresh. ## UI evidence Not applicable; no visible layout change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Streamlined internal cache management for persona imports and bulk import operations to improve code maintainability and reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:25 +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#5230
No description provided.