[PR #705] [MERGED] Fix Prof Mari card update cache invalidation #4735

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

📋 Pull Request Information

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

Base: main ← Head: fix/issue-689-prof-mari-card-update


📝 Commits (1)

  • 5461860 Fix Prof Mari card update cache invalidation

📊 Changes

2 files changed (+36 additions, -0 deletions)

View changed files

➕ docs/pr-evidence/issue-689-cache-proof.md (+32 -0)
📝 packages/client/src/hooks/use-generate.ts (+4 -0)

📄 Description

Linked issue

Closes #689

Why this change

  • Prof Mari could report that a character card was updated while the card detail view still reused a fresh cached copy of the old card. Users checking the card after the toast could see no change even though the server-side update event had fired.

What changed

  • Invalidate the updated character's detail query when Prof Mari emits a character_updated assistant action.
  • Invalidate that character's version-history query as well, so the editor's history stays in sync with the assistant-driven update.
  • Added reviewer-visible cache proof for issue 689 under docs/pr-evidence/.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Codex proof: node scratch/issue-689-cache-proof.mjs reproduced the previous list-only invalidation and verified the patched handler invalidates list, detail, and versions queries:
{
  "before": {
    "listInvalidated": true,
    "detailInvalidated": false,
    "versionsInvalidated": false
  },
  "after": {
    "listInvalidated": true,
    "detailInvalidated": true,
    "versionsInvalidated": true
  }
}
  • Codex proof: pnpm check passed locally.
  • Reviewer-visible proof: docs/pr-evidence/issue-689-cache-proof.md.
  • No true human-only verification blockers for the core cache-invalidation claim.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No user-facing docs, release metadata, schema, dependency, or version files changed.

UI evidence (if applicable)

N/A. This is a non-visual SSE/cache invalidation bug. The reviewer-visible proof is the raw query-cache before/after output in docs/pr-evidence/issue-689-cache-proof.md.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed cache invalidation to ensure character detail and version history properly refresh when characters are updated, preventing stale data display.
  • Documentation

    • Added documentation demonstrating improved cache invalidation behavior.

Review Change Stack


🔄 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/705 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/11/2026 **Status:** ✅ Merged **Merged:** 5/11/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `main` ← **Head:** `fix/issue-689-prof-mari-card-update` --- ### 📝 Commits (1) - [`5461860`](https://github.com/Pasta-Devs/Marinara-Engine/commit/54618608c419fccf972598c503345bac98145629) Fix Prof Mari card update cache invalidation ### 📊 Changes **2 files changed** (+36 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `docs/pr-evidence/issue-689-cache-proof.md` (+32 -0) 📝 `packages/client/src/hooks/use-generate.ts` (+4 -0) </details> ### 📄 Description ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #689 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Prof Mari could report that a character card was updated while the card detail view still reused a fresh cached copy of the old card. Users checking the card after the toast could see no change even though the server-side update event had fired. ## What changed <!-- List the key changes in this PR --> - Invalidate the updated character's detail query when Prof Mari emits a `character_updated` assistant action. - Invalidate that character's version-history query as well, so the editor's history stays in sync with the assistant-driven update. - Added reviewer-visible cache proof for issue 689 under `docs/pr-evidence/`. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Codex proof: `node scratch/issue-689-cache-proof.mjs` reproduced the previous list-only invalidation and verified the patched handler invalidates list, detail, and versions queries: ```json { "before": { "listInvalidated": true, "detailInvalidated": false, "versionsInvalidated": false }, "after": { "listInvalidated": true, "detailInvalidated": true, "versionsInvalidated": true } } ``` - Codex proof: `pnpm check` passed locally. - Reviewer-visible proof: `docs/pr-evidence/issue-689-cache-proof.md`. - No true human-only verification blockers for the core cache-invalidation claim. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No user-facing docs, release metadata, schema, dependency, or version files changed. ## UI evidence (if applicable) N/A. This is a non-visual SSE/cache invalidation bug. The reviewer-visible proof is the raw query-cache before/after output in `docs/pr-evidence/issue-689-cache-proof.md`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed cache invalidation to ensure character detail and version history properly refresh when characters are updated, preventing stale data display. * **Documentation** * Added documentation demonstrating improved cache invalidation behavior. [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/705) <!-- 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:10:12 +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#4735
No description provided.