This repository was archived by the owner on Nov 10, 2026. It is now read-only.
Repository navigation
Conversation
spktrm
force-pushed
the
fix-bot-usertype
branch
from
October 15, 2026 05:03
7f36a4d to
4364c60
Compare
getAssertion only selected banstate, registertime and logintime, so `group` was always undefined and the `group === 10` check never matched. Bot accounts were sent usertype 2 instead of 10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XQgbaPQBwKmTGCy8GuDASp
spktrm
force-pushed
the
fix-bot-usertype
branch
from
October 15, 2026 05:05
4364c60 to
342939f
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Bot accounts (
group = 10) are currently sent usertype2instead of10, so the battle server never setsisUserBot(or autoconfirmed) for them.getAssertionselects onlybanstate, registertime, logintime, so the destructuredgroupis alwaysundefinedand thegroup === 10branch added in bac1c6c can never match. TypeScript doesn't flag it because the row type includesgroup.The fix adds
groupto the selected columns, wrapped as a quoted identifier ("${'group'}", as documented indatabase.ts) so it's escaped for the driver:`group`on MySQL,"group"on Postgres and SQLite. It can't be written inline because it's a reserved word. Baregroupis a syntax error in MySQL, and"group"would be read as a string literal withoutANSI_QUOTES.Test
Added
Should give bot accounts the bot usertypetoactions.test.ts. It registers a user, setsgroup: 10, logs in and checks the usertype in the assertion. The test config has no signing key, so the test uses a throwaway RSA key and restores the old one afterwards.actual: '2', expected: '10'eslintandtscare clean.The other 8 failures in
node --test(userstats, ladder, servertoken and dispatcher tests) fail the same way onmasterwithout this change.