Skip to content

Explain a missing bot instead of returning 502 at Activity sign-in; keep log fields on GoDaddy - #56

Merged
CompleteDotTech merged 1 commit into
mainfrom
fix/bot-not-in-server
Oct 19, 2026
Merged

CompleteDotTech merged 1 commit into
mainfrom
fix/bot-not-in-server

Conversation

@CompleteDotTech

Copy link
Copy Markdown
Contributor

Root cause (verified)

Activity sign-in in Rogue's Community Server returned HTTP 502 … unreadable response. After #55 deployed, production logged auth_stages and http_error for /api/auth/exchange in the same millisecond, so TypeCheck itself returned the 5xx, quickly, not a proxy timeout.

The bot is in only three servers (CompleteTech, Claw N Order, TypeCheck Test), not Rogue's Community Server. An Activity can be launched in a server without the bot. Sign-in then calls GET /guilds/{id}, and Discord answers 404 Unknown Guild (code 10004, reproduced read-only with the bot token against a server it is not in). DiscordRest.json maps every non-401/403 Discord error to 502 discord_http_<status>, and the hosting proxy replaces 502 bodies with its own page.

Change

  • memberInfo: Unknown Guild → bot_not_in_server (409); unknown member → not_a_guild_member (403). Other Discord errors are unchanged.
  • Activity shows: "The TypeCheck bot is not in this server yet. A member with Manage Server needs to add it…"
  • Operational log lines now start with TYPECHECK_EVENT_V1 , like the migration receipts. GoDaddy kept only event and path from bare JSON lines, which hid the error code and stage timings.

Validation

  • npm run check clean; npm test 382/382 pass, including new tests against the real DiscordRest (404 guild, 404 member, 500 unchanged) and the Activity message.
  • SHA256SUMS refreshed and verified.

🤖 Generated with Claude Code

…without it

Rogue's Community Server could launch the TypeCheck Activity, but the bot
is not a member there. Sign-in then asks Discord for the guild, Discord
answers 404 Unknown Guild (code 10004), and the generic mapping turned it
into HTTP 502 discord_http_404, which the hosting proxy replaced with an
unreadable error page. Map that 404 to bot_not_in_server (409) and an
unknown member to not_a_guild_member (403), and show how to add the bot.

Also prefix operational log lines with TYPECHECK_EVENT_V1: the GoDaddy log
processor kept only the event and path keys of bare JSON lines, which hid
the failing code and stage timings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CompleteDotTech
CompleteDotTech merged commit 5f01d75 into main Oct 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant