mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4725] [MERGED] fix(client): move the secret-plot reader off the shared chat-messages query #6479
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6479
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4725
Author: @kolacheee
Created: 8/7/2026
Status: ✅ Merged
Merged: 8/7/2026
Merged by: @kolacheee
Base:
staging← Head:fix/4721-secret-plot-query-key📝 Commits (1)
d4a1acafix(client): move the secret-plot reader off the shared chat-messages query📊 Changes
4 files changed (+59 additions, -6 deletions)
View changed files
📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+10 -4)📝
packages/client/src/hooks/use-chats.ts(+13 -2)📝
packages/client/src/hooks/use-generate.ts(+4 -0)📝
scripts/regressions/open-issues.regression.ts(+32 -0)📄 Description
Linked issue
Closes #4721
Why this change
queryFn,getNextPageParam), not in the key. React Query keeps one options set per key, and the last observer to render wins. The Chat Settings drawer's Director secret-plot reader mounted a second observer on that same key with a hardcodedpageSize: 100, so while the drawer was open (itsenabledgate doesn't matter — observers write options regardless), transcript refetches fetched 100-row pages regardless of the user's messages-per-page,ChatArea's defensive trim then discarded the surplus rows, andhasNextPagemis-evaluated (lastPage.length < 100for 20-row pages →undefined) — hiding Load More while older history still existed.What changed
ChatSettingsDrawer.tsx: the secret-plot reader now usesuseChatMessagePeek(chat.id, 100, …)— the existing limit-keyed, read-only newest-window hook (same endpoint and window, key includes the limit so different windows can never share options). No new machinery; the panel consumes the same newest-100 messages as before. A comment at the call site documents why the shared key is off-limits for feature readers.use-chats.ts: the peek hook's doc comment now covers both directions of the trap — writing a short window into the shared key and merely observing it with a different page size.open-issues.regression.ts: a source-scan pin — the drawer must not observe the shared messages query, the secret-plot reader must go through the limit-keyed peek, and the peek's key must keep including its limit.forMessageIdon the older assistant message, silently re-plotting against truncated history. The authoritative post-generation refresh and the message create/edit/delete mutations now invalidatechatKeys.messagePeek(chatId)alongsidechatKeys.messages(chatId)(the sidebar hover peek benefits identically).The review sweep also confirmed the tracker panel carries the same mis-share (hardcoded
pageSize: 20vs a non-default messages-per-page) — pre-existing and on a different surface, so it's filed separately as #4724 rather than expanded into this PR.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Verified on the production build with a 60-message chat at messages-per-page 20 and a fetch-wrapper request counter:
limit=20(previously the drawer's 100-closure could own the shared options) with zerolimit=100requests, and Load More stays visible.before=…|41→ messages 21–40) with no gap.Still to verify manually (contributor to-do):
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)No user-facing docs impact — internal query-wiring fix.
Summary by CodeRabbit
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.