[v3] feat: add sessionResumedPattern to matching AuthMe's valid_session message - #62
Conversation
…ompt checks The reconnect fallback added earlier assumes login and sends the command anyway when no login/register prompt arrives. That's the right default, but some servers use the prompt as proof the player isn't already authenticated some other way, and a silent reconnect there is a real failure, not a stale session. failOnMissingPrompt (default false) restores the original throw for that case; the rest of the flow is unchanged.
Drownek
commented
Aug 28, 2026
Hey @monikon22, thanks for the PR, and for catching the issue with servers that do strict prompt checks I've been digging through the whole session reconnection flow (including the #57 changes), and I'm not a fan of using a timeout to guess that a session got resumed. It bolts a forced 15s delay onto every session test, and worse, it's a race condition: if CI or the server just lags for a second, we assume a session happened, fire Good news is AuthMeReloaded already tells us when a session resumes, it sends a message (the Here's what I'm thinking: add a That gets rid of the 15-second wait, stops us guessing and sending commands blind, and actually lets us drop Up for taking a pass at reworking the PR this way? Let me know what you think |
…ttern Instead of assuming login and sending a command blind when no prompt shows up in time, wait for AuthMe's own session-resume message alongside the two prompts. A match resolves auth immediately, no command sent; anything else within timeoutMs is now a hard failure instead of a guess. Drops failOnMissingPrompt: a missing prompt has no fallback to opt out of anymore.
sessions.enabled was off, so a reconnecting bot never got AuthMe's resume message and the new code path went untested. Turn it on and add a rejoin test asserting the resume message arrives with no login/register command sent.
monikon22
commented
Aug 28, 2026
Makes sense — pushed a rework along these lines. Added One thing worth flagging: |
Uh oh!
There was an error while loading. Please reload this page.
Follow-up to #57/#60. The fallback there assumes login and sends the command anyway when no login/register prompt arrives — right default, but some servers treat the prompt as proof the player isn't already authenticated some other way, where a silent reconnect is a real failure rather than a stale session.
Adds
failOnMissingPrompt(defaultfalse) toAuthAuthmeOptions. Whentrue, a missing prompt rethrows the original timeout error instead of falling back to login; everything else in the flow is unchanged.No automated test — the repo has no unit-test runner in any npm package (only e2e against a real server), and adding one for a single boolean branch felt like more than the change warranted. Verified with
tsc --noEmitand both stands:plugwrightTestLocal: 50/50 passplugwrightTestStand: 44/44 pass, 6 skip, 0 fail