mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5956] A GM turn can only keep one dice card — multiple rolls in a turn should all survive #3298
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#3298
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 (Sep 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5956
Originally assigned to: @SpicyMarinara on GitHub.
From #5924's known limitations: "A turn that rolls more than once keeps only the last card." The GM should be able to roll several times in one turn and have every roll survive — a fight round with an attack and a damage roll is the ordinary case, not an exotic one.
Where the seam is. The record is a single object, not a list:
The server holds one mutable slot for the whole generation (
routes/generate.routes.ts:6383), overwrites it on every successfulroll_dice(:6632), and writes that one value at the end of the turn (:7741, whose own comment says only the last roll is kept). It gets clobbered on two axes: several rolls returned in one response, and one roll per round across many rounds.No number is wrong — this is display and durability only. Every roll goes back to the model as its own
role: "tool"message, passed through verbatim on success (:6730-6735,tool-executor.ts:74). So the GM's narration is honest about all N rolls; only the card and the saved record collapse.What a player sees today: card A appears, card B replaces it mid-turn with the 5-second dismiss timer restarting (
GameDiceResult.tsx:17-28); when both rolls come back in the same round, A is overwritten before its entrance animation finishes, so it reads as a flicker. After the turn, the Game surface doesn't redraw cards from the saved record at all — the persisted value is currently written but never rendered there.Most of the pipe is already plural. SSE emits one
tool_resultframe per roll, each carrying its own parsed card (:6638-6646). The collapse happens entirely in two consumers: the single store slot (stores/game-mode.store.ts:39) and the single message-extra field.What a fix touches:
/rollwrites the singular field today and the Roleplay/Conversation renderers read it. It's a JSON blob so no migration, but the merge is shallow: a writer that sets only the new list must explicitly null the old field, or a re-rolled swipe keeps a stale card.lib/dice-roll-result.tsis the single narrowing point for both the stored extra and the SSE frame — one companion that accepts either shape covers both readers.shouldAnimateDiceRollMessage's 10-second window (AnimatedDiceRoll.tsx:46-51) — every card in a list shares one messagecreatedAt, so a naive plural renderer would replay them all at once.game-mode-dice-tool.regression.ts:434-442,dice-notation.regression.ts:573-598,spatial-only-message-visibility.regression.ts:36, ande2e/game-native-dice.e2e.ts:132,169(its locator assumes exactly one card).Not the same bug, but worth knowing while in here: #5923's server-rolled skill checks are fine — they're rewritten into the message content and re-parsed as an array, so three checks in a turn render as three log lines and survive reload (
GameNarration.tsx:950-971). Their only single-slot limit is that just the first check gets the animated banner (GameSurface.tsx:4934-4937). That's first-wins on a transient overlay; this issue is last-wins on a durable record. Fixing one doesn't fix the other, but they'd sit naturally in the same pass.@SpicyMarinara commented on GitHub (Sep 8, 2026):
Implementation is owned by @SpicyMarinara with Codex in draft #5979, as part of the authorized issue sweep. The work reuses the shared dice parser, existing cards, and per-swipe metadata.