mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#2594
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?
Originally created by @kolacheee on GitHub (Aug 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4724
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The tracker panel's sprite-expression lookup mounts a
useChatMessagesobserver with a hardcodedpageSize: 20on the same React Query key the chat transcript uses with the user's messages-per-page — the same options mis-share fixed for the Chat Settings drawer in #4721, from a different observer. When messages-per-page is set to anything other than 20, whichever observer rendered last owns the shared query's fetch closures, and the transcript's pagination runs with the wrong page size.Expected behavior
The tracker panel's message reads have no effect on the transcript's pagination: refetches fetch messages-per-page-sized pages and "Load More" reflects the real history.
Actual behavior
With messages-per-page ≠ 20 and the tracker panel mounted with sprite-expression lookup enabled:
limit=20instead of the user's setting.ChatArea'shasNextPageis computed from its observer options, sogetNextPageParamevaluates a 20-row page againstpageSize = 50(for example):20 < 50→undefined→ "Load More" disappears with older history still present. The defensive newest-page trim doesn't compensate — it only trims pages longer than the transcript's page size.Code locations (current staging):
packages/client/src/features/tracker-panel/hooks/use-tracker-panel-model.ts:74—useChatMessages(activeChatId, 20, spriteExpressionLookupEnabled)packages/client/src/components/chat/ChatArea.tsx:751— transcript observer at the user'smessagesPerPage(0–500 in Settings; default 20 — which is why the default configuration masks the bug)packages/client/src/hooks/use-chats.ts—useChatMessageskeys by chat id only; page size lives in thequeryFn/getNextPageParamclosuresSteps to reproduce
limit=20and "Load More" can vanish although older history exists.Environment
c4f15f373)Logs, screenshots, or video
Found by the adversarial review sweep run on the #4721 fix (the sweep lens explicitly looked for remaining instances of the class). Confirmed against
@tanstack/query-core@5.100.9:QueryObserver.setOptionswrites the shared query's options with noenabledguard, so the tracker's observer participates even while itsenabledgate is false.Additional context
Same fix shape as #4721 (merged fix pending in its PR): the sprite-expression lookup is a read-only newest-window consumer — it should read through the limit-keyed
useChatMessagePeek(or an equivalent dedicated key) rather than observing the shared transcript query. When fixed, extend the #4721 source-scan regression pin (currently guarding onlyChatSettingsDrawer.tsx) to coveruse-tracker-panel-model.ts, or generalize it to allow only the sanctioned transcript observers on the shared key.Kept out of the #4721 PR deliberately — pre-existing, different surface, and the tracker's consumer shape (
MessageWithSwipesusage for sprite lookups) needs its own look before swapping the data source.Template check
@SpicyMarinara commented on GitHub (Aug 7, 2026):
SpicyMarinara/Codex is implementing this in draft PR #4736 on
agent/assigned-issues-4718-4734.@kolacheee commented on GitHub (Aug 7, 2026):
Resolved by #4736 (staging): use-tracker-panel-model.ts now reads message data through useChatMessagePeek(activeChatId, 20, ...) - the isolated peek query introduced for #4721 - instead of observing the shared chat-messages infinite query with a hardcoded pageSize of 20. With no observer on the shared key, the last-observer-wins options hijack this issue describes can no longer occur; the 20 is now just the peek's own fetch limit, which affects nothing outside the tracker panel. Verified against current staging code. Closing.