[PR #1015] [MERGED] Fix stale game session rendering #4885

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

📋 Pull Request Information

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

Base: staging ← Head: fix/issue-1003-game-session-current-proof


📝 Commits (1)

  • 0dbf8bc Fix stale game session rendering

📊 Changes

4 files changed (+66 additions, -1 deletions)

View changed files

➕ docs/pr-evidence/issue-1003/browser-after.png (+0 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+11 -0)
📝 packages/client/src/components/layout/ChatSidebar.tsx (+5 -1)
➕ packages/client/src/lib/game-session-resolution.ts (+50 -0)

📄 Description

Linked issue

Closes #1003

Why this change

  • Game mode could remain pointed at an older session in the same game group even after chat metadata and the sidebar reflected a newer current session. That left the game surface rendering stale content until another session change forced the active chat forward.

What changed

  • Added a shared game-session resolver that chooses the current game session by session number, then updated/created timestamps.
  • Updated ChatArea to redirect stale active game-session chat IDs to the current session in the same game group.
  • Updated collapsed game groups in ChatSidebar to use the same current-session representative.
  • Added reviewer-visible evidence for the Session 31 current-content state.

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 reproduced the stale active-session mechanism with node scratch/issue-1003-session-resolution.mjs: before the fix, active chat state could remain on session-26 while session-31 was the current game session in the same group.
  • Codex verified the resolver behavior with packages\server\node_modules\.bin\tsx.cmd scratch/issue-1003-session-resolution.mjs: stale session-26 resolves to session-31, the sidebar representative is session-31, already-current game sessions remain unchanged, and non-game chats remain unchanged.
  • Codex ran pnpm check; it passed impeccable:check, lint, and shared/server/client builds.
  • The exact original Discord sequence is not fully known, so the proof targets the stale active-chat/session-selection mechanism rather than the suspected lorebook-deletion path.

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)

Docs/release note: no docs, schema, dependency, or version files changed.

UI evidence (if applicable)

Game surface rendering Session 31 current content

Note: the screenshot includes a local CSRF trust banner from the dev origin; it is unrelated to this fix. The relevant evidence is the game surface rendering SESSION 31 CURRENT CONTENT.


🔄 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/1015 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/19/2026 **Status:** ✅ Merged **Merged:** 5/19/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `staging` ← **Head:** `fix/issue-1003-game-session-current-proof` --- ### 📝 Commits (1) - [`0dbf8bc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0dbf8bcfcd0096b319f5882e14415286cd46da24) Fix stale game session rendering ### 📊 Changes **4 files changed** (+66 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `docs/pr-evidence/issue-1003/browser-after.png` (+0 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+11 -0) 📝 `packages/client/src/components/layout/ChatSidebar.tsx` (+5 -1) ➕ `packages/client/src/lib/game-session-resolution.ts` (+50 -0) </details> ### 📄 Description <!-- Target branch: `staging`. The default base in this UI is `main` (release branch). --> <!-- Change the base to `staging` before submitting unless this is a maintainer-approved mainline change. --> <!-- See CONTRIBUTING.md § Branches. --> ## 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 #1003 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Game mode could remain pointed at an older session in the same game group even after chat metadata and the sidebar reflected a newer current session. That left the game surface rendering stale content until another session change forced the active chat forward. ## What changed <!-- List the key changes in this PR --> - Added a shared game-session resolver that chooses the current game session by session number, then updated/created timestamps. - Updated `ChatArea` to redirect stale active game-session chat IDs to the current session in the same game group. - Updated collapsed game groups in `ChatSidebar` to use the same current-session representative. - Added reviewer-visible evidence for the Session 31 current-content state. ## 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 reproduced the stale active-session mechanism with `node scratch/issue-1003-session-resolution.mjs`: before the fix, active chat state could remain on `session-26` while `session-31` was the current game session in the same group. - Codex verified the resolver behavior with `packages\server\node_modules\.bin\tsx.cmd scratch/issue-1003-session-resolution.mjs`: stale `session-26` resolves to `session-31`, the sidebar representative is `session-31`, already-current game sessions remain unchanged, and non-game chats remain unchanged. - Codex ran `pnpm check`; it passed `impeccable:check`, lint, and shared/server/client builds. - The exact original Discord sequence is not fully known, so the proof targets the stale active-chat/session-selection mechanism rather than the suspected lorebook-deletion path. ## 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) Docs/release note: no docs, schema, dependency, or version files changed. ## UI evidence (if applicable) ![Game surface rendering Session 31 current content](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/0dbf8bcfcd0096b319f5882e14415286cd46da24/docs/pr-evidence/issue-1003/browser-after.png) Note: the screenshot includes a local CSRF trust banner from the dev origin; it is unrelated to this fix. The relevant evidence is the game surface rendering `SESSION 31 CURRENT CONTENT`. --- <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:26 +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#4885
No description provided.