[PR #684] [MERGED] Fix tracker panel refresh after retry trackers #4730

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

📋 Pull Request Information

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

Base: main ← Head: fix/tracker-panel-retry-refresh


📝 Commits (1)

  • 660bfce Fix tracker retry panel refresh

📊 Changes

1 file changed (+28 additions, -45 deletions)

View changed files

📝 packages/client/src/hooks/use-generate.ts (+28 -45)

📄 Description

Linked issue

No linked issue. This is a maintainer-approved follow-up fix for the tracker panel feature.

Why this change

  • The tracker panel could stay empty while it was already open if retry trackers produced the first visible tracker data for the active chat. Closing and reopening worked because the remount fetched the full game-state snapshot from the server.

What changed

  • Added a shared client helper for streamed game-state patches so both normal generation and retry tracker streams attach the owning chat id before writing to the shared game-state store.
  • Preserved the existing same-chat merge behavior for standard tracker updates, including the partial playerStats merge and active quest protection.
  • Avoided merging streamed tracker patches into a stale game-state snapshot from another chat.

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

  • Code-path reproduction before fix: retry game_state_patch without chatId was ignored by the tracker panel selector.
  • Code-path verification after fix: retry patch seeded with chatId is visible to the tracker panel selector.
  • Edge check: same-chat patches still merge into existing state and preserve existing active quests when a partial empty quest list arrives.
  • Edge check: patches for the active chat no longer merge into a stale snapshot from another chat.
  • Automated validation run by Codex: pnpm check passed locally.
  • Used a chat where the panel starts empty, retried a tracker, confirmed data appears while the panel stays open.
  • Retried a tracker on a chat that already had tracker data, confirmed it updates without wiping unrelated tracker sections.
  • Retried Character, Persona, Quest, and Custom trackers one at a time, checking each section updates normally.
  • Sent a regular roleplay message with automatic trackers enabled. Confirmed standard tracker updates still appear normally.

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)

Summary by CodeRabbit

  • Refactor
    • Improved internal handling of game state updates to enhance consistency and reliability during streaming events.

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/684 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/11/2026 **Status:** ✅ Merged **Merged:** 5/11/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `main` ← **Head:** `fix/tracker-panel-retry-refresh` --- ### 📝 Commits (1) - [`660bfce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/660bfce4851445985283aad0ea4693d90fac9f48) Fix tracker retry panel refresh ### 📊 Changes **1 file changed** (+28 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/hooks/use-generate.ts` (+28 -45) </details> ### 📄 Description ## Linked issue No linked issue. This is a maintainer-approved follow-up fix for the tracker panel feature. ## Why this change - The tracker panel could stay empty while it was already open if retry trackers produced the first visible tracker data for the active chat. Closing and reopening worked because the remount fetched the full game-state snapshot from the server. ## What changed - Added a shared client helper for streamed game-state patches so both normal generation and retry tracker streams attach the owning chat id before writing to the shared game-state store. - Preserved the existing same-chat merge behavior for standard tracker updates, including the partial `playerStats` merge and active quest protection. - Avoided merging streamed tracker patches into a stale game-state snapshot from another chat. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [X] Ran the app, clicked through the changes manually - [X] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Code-path reproduction before fix: retry `game_state_patch` without `chatId` was ignored by the tracker panel selector. - Code-path verification after fix: retry patch seeded with `chatId` is visible to the tracker panel selector. - Edge check: same-chat patches still merge into existing state and preserve existing active quests when a partial empty quest list arrives. - Edge check: patches for the active chat no longer merge into a stale snapshot from another chat. - Automated validation run by Codex: `pnpm check` passed locally. - - Used a chat where the panel starts empty, retried a tracker, confirmed data appears while the panel stays open. - Retried a tracker on a chat that already had tracker data, confirmed it updates without wiping unrelated tracker sections. - Retried Character, Persona, Quest, and Custom trackers one at a time, checking each section updates normally. - Sent a regular roleplay message with automatic trackers enabled. Confirmed standard tracker updates still appear normally. ## Docs and release impact - [x] 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) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Improved internal handling of game state updates to enhance consistency and reliability during streaming events. [![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/684) <!-- 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:10 +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#4730
No description provided.