[PR #6821] [MERGED] fix: keep Author's Notes attached to their chat #7341

Closed
opened 2026-10-23 04:18:50 +07:00 by bsakaguchi Ā· 0 comments
Owner

šŸ“‹ Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6821
Author: @SpicyMarinara
Created: 9/28/2026
Status: āœ… Merged
Merged: 9/28/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/fix-6817-authors-notes


šŸ“ Commits (4)

  • 601753a docs: track author notes isolation fix (#6817)
  • af58975 fix(chat): serialize Author's Notes saves (#6817)
  • d7f786f test(chat): finish mocked generation before asserting notes
  • 6dea8f8 Merge branch 'staging' into codex/fix-6817-authors-notes

šŸ“Š Changes

3 files changed (+220 additions, -1 deletions)

View changed files

šŸ“ CHANGELOG.md (+2 -0)
āž• e2e/author-notes.e2e.ts (+217 -0)
šŸ“ packages/client/src/components/chat/ChatRoleplayPanels.tsx (+1 -1)

šŸ“„ Description

Linked issue

Closes #6817

Why this change

Author’s Notes bypassed the existing per-chat metadata save queue. A delayed older save could overwrite a newer edit, and generation could read storage before the note finished saving. A controlled browser reproduction observed two simultaneous note PATCH requests while the first was held.

What changed

  • Opt the Author’s Notes editor into the existing serialized metadata writer. Its blur, expanded-editor close, depth edit, and unmount saves all use the same per-chat queue that generation already waits for.
  • Retain a focused browser regression covering ordered saves, generation waiting, editing another chat while a save is held, reload, per-chat server prompt contents, and failed-save/newer-draft retry.
  • Add a concise Unreleased changelog entry. No new storage, dependency, or UI copy.

Validation

Current PR head 6dea8f80b6b6c835553268f3941d83bce031b993 is the automatic merge of staging fd859ccd1055a7ed741c1adda1afbb1ef15a842d into d7f786f448c2414e996009e8883c409b1adea94e. The Author’s Notes product and test blobs are unchanged; the source-equivalence audit preserves the earlier feature proofs below.

The new-base combined candidate 867d64d0208e49cce13c40310d81839756fad787 (tree 3610bb1dbbf9b0429d7532831e3e91cdf34bff7c) passed pnpm install, pnpm check, and browser smoke 7/7. Its Author’s Notes source/test blobs exactly match the published PR head. These checks ran on that combined integration candidate, not as a new focused feature run on the individual merge-only head.

Baseline product-source validation at af58975bb68f64db3e2a2451fede159e5447879d; final test-only follow-up d7f786f448c2414e996009e8883c409b1adea94e keeps that product source unchanged:

  • pnpm install completed.

  • pnpm check passed (two existing GameSurface hook dependency warnings; no errors).

  • pnpm regression:prompt passed all three regression files.

  • pnpm smoke:ui passed 7/7.

  • pnpm exec playwright test e2e/author-notes.e2e.ts --workers=1 passed 6/6 across desktop Chromium, mobile Chromium, and mobile WebKit.

  • Final changed-file Prettier, pnpm check:e2e-types, and all six focused browser cases passed again at d7f786f448c2414e996009e8883c409b1adea94e after moving the notes assertion out of the mock generation route (CodeRabbit discussion4124993133).

  • Independent source review found no substantive issues. Local CodeRabbit completed on combined candidate c172ae4ccef3d7052de04b5a8a198e6f308e1e74, whose Author’s Notes source/test blobs exactly match this head. It raised no findings in this PR; its three findings concern the other two combined PRs and are tracked there. The combined unchanged product sources also passed pnpm check, smoke 7/7, both feature suites 12/12, and mobile keyboard cases 2/2.

  • Hosted CodeRabbit reviewed the original head; its one fixture finding is fixed in d7f786f4 and the thread is resolved. The current merge-only head’s hosted review is rate-limited and remains a merge gate; a retry is coordinated separately. The macOS Intel build passed on the pre-base-merge d7f786f4 after a prior runner timed out during startup of an unchanged shutdown fixture; this is historical proof, not a claim about current-head CI.

  • 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

Manually verify editing notes in two roleplay chats, switching while a save is pending, reloading, and inspecting each chat’s prompt. The automated browser checks use disposable fixture chats and real server dry-run prompt assembly; generation transport is intercepted to assert the client save barrier. Current chat-ID-keyed panels did not reproduce a direct cross-chat storage leak. The confirmed defect is concurrent saves; the isolation assertions guard the reported symptom. Mobile checks are browser emulation, not physical-device testing. A rejected storage save is not a promise of offline durability or successful prompt injection.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

Only the changelog changes; no user-facing docs or release metadata change.

UI evidence (if applicable)

Inspected before/after fixture screenshots in a standalone HTML evidence file. Download/open the HTML to view embedded images. It labels the original desktop failure state and final desktop/mobile states, records the tested commit, and distinguishes network assertions from screenshot evidence. This fix does not alter visual styling.

Summary by CodeRabbit

  • Bug Fixes
    • Author’s Notes edits are saved in order and kept separate for each roleplay chat.
    • Generation now waits for pending note edits to save, ensuring it uses the latest notes.
    • Unsaved drafts remain visible if a save fails and can be saved again.

šŸ”„ 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/6821 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/28/2026 **Status:** āœ… Merged **Merged:** 9/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/fix-6817-authors-notes` --- ### šŸ“ Commits (4) - [`601753a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/601753ace0d29ab58b2049151f9353a4294878de) docs: track author notes isolation fix (#6817) - [`af58975`](https://github.com/Pasta-Devs/Marinara-Engine/commit/af58975bb68f64db3e2a2451fede159e5447879d) fix(chat): serialize Author's Notes saves (#6817) - [`d7f786f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d7f786f448c2414e996009e8883c409b1adea94e) test(chat): finish mocked generation before asserting notes - [`6dea8f8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6dea8f80b6b6c835553268f3941d83bce031b993) Merge branch 'staging' into codex/fix-6817-authors-notes ### šŸ“Š Changes **3 files changed** (+220 additions, -1 deletions) <details> <summary>View changed files</summary> šŸ“ `CHANGELOG.md` (+2 -0) āž• `e2e/author-notes.e2e.ts` (+217 -0) šŸ“ `packages/client/src/components/chat/ChatRoleplayPanels.tsx` (+1 -1) </details> ### šŸ“„ Description ## Linked issue Closes #6817 ## Why this change Author’s Notes bypassed the existing per-chat metadata save queue. A delayed older save could overwrite a newer edit, and generation could read storage before the note finished saving. A controlled browser reproduction observed two simultaneous note PATCH requests while the first was held. ## What changed - Opt the Author’s Notes editor into the existing serialized metadata writer. Its blur, expanded-editor close, depth edit, and unmount saves all use the same per-chat queue that generation already waits for. - Retain a focused browser regression covering ordered saves, generation waiting, editing another chat while a save is held, reload, per-chat server prompt contents, and failed-save/newer-draft retry. - Add a concise Unreleased changelog entry. No new storage, dependency, or UI copy. ## Validation Current PR head `6dea8f80b6b6c835553268f3941d83bce031b993` is the automatic merge of staging `fd859ccd1055a7ed741c1adda1afbb1ef15a842d` into `d7f786f448c2414e996009e8883c409b1adea94e`. The Author’s Notes product and test blobs are unchanged; the source-equivalence audit preserves the earlier feature proofs below. The new-base combined candidate `867d64d0208e49cce13c40310d81839756fad787` (tree `3610bb1dbbf9b0429d7532831e3e91cdf34bff7c`) passed `pnpm install`, `pnpm check`, and browser smoke 7/7. Its Author’s Notes source/test blobs exactly match the published PR head. These checks ran on that combined integration candidate, not as a new focused feature run on the individual merge-only head. Baseline product-source validation at `af58975bb68f64db3e2a2451fede159e5447879d`; final test-only follow-up `d7f786f448c2414e996009e8883c409b1adea94e` keeps that product source unchanged: - `pnpm install` completed. - `pnpm check` passed (two existing GameSurface hook dependency warnings; no errors). - `pnpm regression:prompt` passed all three regression files. - `pnpm smoke:ui` passed 7/7. - `pnpm exec playwright test e2e/author-notes.e2e.ts --workers=1` passed 6/6 across desktop Chromium, mobile Chromium, and mobile WebKit. - Final changed-file Prettier, `pnpm check:e2e-types`, and all six focused browser cases passed again at `d7f786f448c2414e996009e8883c409b1adea94e` after moving the notes assertion out of the mock generation route (CodeRabbit discussion4124993133). - Independent source review found no substantive issues. Local CodeRabbit completed on combined candidate `c172ae4ccef3d7052de04b5a8a198e6f308e1e74`, whose Author’s Notes source/test blobs exactly match this head. It raised no findings in this PR; its three findings concern the other two combined PRs and are tracked there. The combined unchanged product sources also passed `pnpm check`, smoke 7/7, both feature suites 12/12, and mobile keyboard cases 2/2. - Hosted CodeRabbit reviewed the original head; its one fixture finding is fixed in `d7f786f4` and the thread is resolved. The current merge-only head’s hosted review is rate-limited and remains a merge gate; a retry is coordinated separately. The [macOS Intel build passed](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/36457153740/job/109046288881) on the pre-base-merge `d7f786f4` after a prior runner timed out during startup of an unchanged shutdown fixture; this is historical proof, not a claim about current-head CI. - [ ] `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 Manually verify editing notes in two roleplay chats, switching while a save is pending, reloading, and inspecting each chat’s prompt. The automated browser checks use disposable fixture chats and real server dry-run prompt assembly; generation transport is intercepted to assert the client save barrier. Current chat-ID-keyed panels did not reproduce a direct cross-chat storage leak. The confirmed defect is concurrent saves; the isolation assertions guard the reported symptom. Mobile checks are browser emulation, not physical-device testing. A rejected storage save is not a promise of offline durability or successful prompt injection. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) Only the changelog changes; no user-facing docs or release metadata change. ## UI evidence (if applicable) [Inspected before/after fixture screenshots in a standalone HTML evidence file](https://gist.github.com/SpicyMarinara/2e233ab99a8a3bbe2b55be8a05fc4a7b). Download/open the HTML to view embedded images. It labels the original desktop failure state and final desktop/mobile states, records the tested commit, and distinguishes network assertions from screenshot evidence. This fix does not alter visual styling. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Author’s Notes edits are saved in order and kept separate for each roleplay chat. * Generation now waits for pending note edits to save, ensuring it uses the latest notes. * Unsaved drafts remain visible if a save fails and can be saved again. <!-- 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-23 04:18:50 +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#7341
No description provided.