Refuse a non-integer snapshotId as malformed, not stale - #486
Merged
davidmckayv merged 2 commits intoSep 11, 2026
Merged
Conversation
Ayush7614
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
September 11, 2026 09:57
# Conflicts: # CHANGELOG.md
davidmckayv
approved these changes
Sep 11, 2026
davidmckayv
left a comment
Contributor
There was a problem hiding this comment.
Deep-reviewed clean (validation, no secret leak, fail-closed, agrees with existing layers). CI green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
asRefandPOST /:botId/control/secretaccepted anytypeof === numberas a snapshot id.1.5andInfinity(valid JSON:1e999parses to it) then never equalled the stored integer, so the gateway reported a stale snapshot (409) plus an allowed-then-failed audit pair, and the caller retried a request that was malformed. Both sites now requireNumber.isInteger; malformed ids answer the existing 400 bad-ref before any decision or audit row.Covers the acting routes through
asRef(click/type and the rest) and the secret route which checks inline.Where it runs
Boundary and audit
Changelog
CHANGELOG.mdunderUnreleased: fractional/infinite snapshot id entry.Proof
bun test server/tests/computer-snapshot-id.test.ts: 7 pass (integer reaches gateway; float, Infinity, -Infinity, string, null, boolean each 400 with the bad-ref message and zero gateway calls).bun test server/tests/computer-scroll-delta.test.ts: still green (neighbouring edge-validation suite).bun run format:check: clean.bun run lint: clean.bun run typecheckserver/workspace OK; app has the pre-existingembla-carousel-reactfailure identical on clean main).