[PR #1168] [MERGED] [codex] fix character cache churn #4951

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1168
Author: @ghost
Created: 5/24/2026
Status: ✅ Merged
Merged: 5/25/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/refactor-pr-54-character-cache-churn


📝 Commits (1)

  • 79f0755 Migrate Refactor PR #54: Fix character cache churn

📊 Changes

4 files changed (+96 additions, -10 deletions)

View changed files

📝 src/features/catalog/characters/components/ImportCharacterModal.tsx (+22 -3)
📝 src/features/catalog/characters/hooks/use-characters.ts (+68 -4)
📝 src/features/shell/bot-browser/api/bot-browser-api.ts (+1 -0)
📝 src/features/shell/bot-browser/components/BotBrowserView.tsx (+5 -3)

📄 Description

Migrated from Pasta-Devs/Marinara-Engine-Refactor#54: https://github.com/Pasta-Devs/Marinara-Engine-Refactor/pull/54
Original author: @Promansis
Target base: Pasta-Devs/Marinara-Engine refactor
Source draft state: True
Verification after port: pnpm typecheck
Port note: source updates/ tracker/evidence files were omitted because the target refactor branch removed repo-local updates guidance.


Closes #39

Why this change

Character import and delete paths were refreshing the full character list even when the mutation response already contained enough data to patch the React Query cache. That caused avoidable refetch churn in the character UI.

What changed

  • Added small character-list cache helpers in the character feature hook owner.
  • Updated create, duplicate, delete, and import flows to patch the list cache directly when the response contains a usable character record.
  • Kept a single invalidation fallback when a successful import does not return enough data to patch the cache safely.
  • Recorded the issue ownership update in the local updates file.

Validation

  • pnpm typecheck
  • pnpm check
  • Ran pnpm tauri dev and tested the app path manually
  • Verified the affected feature in the right mode(s): imports/exports

Manual verification notes

Codex verification:

  • pnpm check passed on PR head in an isolated worktree.
  • A local no-commit merge of current upstream/refactor into the PR head merged cleanly.
  • pnpm check passed after that local merge proof.
  • GitHub CI is green.
  • CodeRabbit status is green with no actionable inline review threads.

Manual follow-up:

  • Live desktop smoke for import/delete refetch observation has not been run.

Docs impact

  • No docs changes needed

UI evidence

N/A. Cache behavior change; no reviewer-visible UI screenshot captured.


🔄 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/1168 **Author:** [@ghost](https://github.com/ghost) **Created:** 5/24/2026 **Status:** ✅ Merged **Merged:** 5/25/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/refactor-pr-54-character-cache-churn` --- ### 📝 Commits (1) - [`79f0755`](https://github.com/Pasta-Devs/Marinara-Engine/commit/79f07555ff9a8aecba80bb53b4a13316f9ee4863) Migrate Refactor PR #54: Fix character cache churn ### 📊 Changes **4 files changed** (+96 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/features/catalog/characters/components/ImportCharacterModal.tsx` (+22 -3) 📝 `src/features/catalog/characters/hooks/use-characters.ts` (+68 -4) 📝 `src/features/shell/bot-browser/api/bot-browser-api.ts` (+1 -0) 📝 `src/features/shell/bot-browser/components/BotBrowserView.tsx` (+5 -3) </details> ### 📄 Description Migrated from Pasta-Devs/Marinara-Engine-Refactor#54: https://github.com/Pasta-Devs/Marinara-Engine-Refactor/pull/54 Original author: @Promansis Target base: Pasta-Devs/Marinara-Engine refactor Source draft state: True Verification after port: `pnpm typecheck` Port note: source updates/ tracker/evidence files were omitted because the target refactor branch removed repo-local updates guidance. --- Closes #39 ## Why this change Character import and delete paths were refreshing the full character list even when the mutation response already contained enough data to patch the React Query cache. That caused avoidable refetch churn in the character UI. ## What changed - Added small character-list cache helpers in the character feature hook owner. - Updated create, duplicate, delete, and import flows to patch the list cache directly when the response contains a usable character record. - Kept a single invalidation fallback when a successful import does not return enough data to patch the cache safely. - Recorded the issue ownership update in the local updates file. ## Validation - [ ] `pnpm typecheck` - [ ] `pnpm check` - [ ] Ran `pnpm tauri dev` and tested the app path manually - [ ] Verified the affected feature in the right mode(s): imports/exports ### Manual verification notes Codex verification: - `pnpm check` passed on PR head in an isolated worktree. - A local no-commit merge of current `upstream/refactor` into the PR head merged cleanly. - `pnpm check` passed after that local merge proof. - GitHub CI is green. - CodeRabbit status is green with no actionable inline review threads. Manual follow-up: - Live desktop smoke for import/delete refetch observation has not been run. ## Docs impact - [ ] No docs changes needed ## UI evidence N/A. Cache behavior change; no reviewer-visible UI screenshot captured. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:11:58 +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#4951
No description provided.