mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8784] [MERGED] fix(multiplayer): whispered own rolls, Retry at the generation limit, IPv6 request buckets #8802
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#8802
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/8784
Author: @SpicyMarinara
Created: 11/3/2026
Status: ✅ Merged
Merged: 11/3/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/multiplayer-rolls-retry-limits📝 Commits (2)
a244a5cfix(multiplayer): whispered own rolls, Retry at the generation limit, IPv6 request buckets89b1509fix(client): keep the Retry limit message after the host raises the limit📊 Changes
8 files changed (+94 additions, -7 deletions)
View changed files
📝
packages/client/src/features/multiplayer/MultiplayerHostControls.tsx(+11 -2)📝
packages/client/src/localization/locales/en.json(+1 -0)📝
packages/server/src/services/multiplayer/game-projection.ts(+6 -1)📝
packages/server/src/services/multiplayer/peer-server.ts(+2 -1)📝
packages/server/src/services/multiplayer/room-store.ts(+7 -1)📝
scripts/regressions/multiplayer-game-projection.regression.ts(+21 -0)📝
scripts/regressions/multiplayer-peer-server-security.regression.ts(+36 -2)📝
scripts/regressions/multiplayer-room.regression.ts(+10 -0)📄 Description
Linked issue
Closes #8783
Why this change
A release-prep audit found three multiplayer defects, and two verifiers confirmed each one. (1) A player never saw the result of a check the Game Master whispered to them. ownRolls read an audience key that nothing writes, and the transcript strips the check tag. (2) When a failed round had used the room's last allowed generation, Retry reported success but left the room active and stuck. The failure banner and Retry button disappeared, and guests' actions were refused. (3) The room listener limited requests per full IPv6 address but sockets per /64. One IPv6 host could multiply its per-address request budget across the addresses in its /64 and use up the shared pre-auth budget that admitted guests also need. No linked issue exists; one should be opened before the PR is submitted.
What changed
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Agent-run checks (for reference; each regression was shown to fail without its fix):
node ./scripts/pnpm-runner.mjs build:shared: exit 0node ./scripts/run-regressions.mjs --filter multiplayer- (after the banner fix): 16/16 passed, including multiplayer-game-projection, multiplayer-room and multiplayer-peer-server-security (18.4 s)git stash push -- the 3 server source files; run the 3 touched regressions; git stash pop (first round): All 3 FAILED on the new assertions, and passed with the fix restored(packages/server) node ../../scripts/pnpm-runner.mjs lint [tsc -b ../shared && tsc --noEmit && tsc -p character-activity]: exit 0(packages/client) npx eslint src/features/multiplayer/MultiplayerHostControls.tsx: exit 0(packages/client) npx tsc -b; npx tsc -p ../../scripts/regressions/tsconfig.client-lanes.json: both exit 0prettier --write MultiplayerHostControls.tsx; prettier --check on all 8 files changed against origin/staging: All matched files use Prettier code stylenode ./scripts/pnpm-runner.mjs localization:check: exit 0Search the installed packages (worktree .pnpm virtual store) for jsdom, happy-dom, linkedom, react-test-renderer or react-reconciler: None installed, so a click-driven client regression for the banner would need a new dependencyIndependent adversarial review: changes, 2 issue(s), all addressed in a fix-up pass.
Known limits and risks:
Low overall, with these known limits. (1) The pre-auth global request budget (requestsGlobal 300/min) is still spent before the method, path and bearer checks. Three or more /64s (one residential /56 or hosting /48) or three or more IPv4 addresses, each using its 120/min bucket, can still use it up and rate-limit admitted guests. This change only stops one host from multiplying its budget across its own /64. A follow-up is still needed: reserve part of the budget for approved session tokens. (2) IPv6 guests on one LAN all get addresses in its single /64 (SLAAC), and link-local fe80:: guests all map to fe80::/64. They now share one 120/min request bucket where each used to have its own, the same way they already shared the 16-socket limit. An idle guest polls about 3 times a minute, but every room change wakes every guest's poll and each guest may send up to 30 actions (service.ts:700). A busy table of IPv6 guests on one LAN could therefore reach the shared bucket. On the internet, several guests behind one IPv4 NAT already share a bucket, but on a LAN, IPv4 guests each have their own private address. (3) The banner's choice between retryLimitReached and retryRefused uses the snapshot at the moment Retry is pressed. Both server refusals return 'busy', so the error alone cannot tell them apart. The host snapshot refetches every 2 s and the failed round is already counted when the banner appears, so the value at press time is accurate. There is no automated test for this client wiring: the repo has no DOM library or non-DOM React renderer, so it is covered by manual verification. (4) At generations == 1000, the schema maximum, the limit cannot be raised, so the limit message cannot be acted on there. The reviewer judged this not worth blocking. (5) The peer-server regression leg shadows TLSSocket.prototype.remoteAddress (test-only, removed in finally). It relies on the https server reading request.socket.remoteAddress through the TLSSocket prototype chain, which held on Node 24.22.1. That regression took 18-25 s under load against its 30 s per-file limit, and the base version took about as long, so the timeout risk predates this change. (6) Not done here: the user's relayed request to make showing off an outfit to a love interest in Otome Hearth give +5 affection instead of +20. Otome Hearth (otome-forge) is a downloadable package owned by Pasta-Devs/Marinara-Agents, and this repository contains no otome-forge code. Under AGENTS.md routing, the orchestrator must carry it out in a separate Marinara-Agents step against that repo's staging branch so the request is not dropped.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.