Repository navigation
Handle Twitch unban rejections without internal error alerts - #1747
Merged
Merged
Conversation
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.
Two authenticated Twitch
/unbanrequests at 2026-10-29 11:41:47 and 11:41:49 UTC returned HTTP 500/INTERNAL and created Error Reporting groupCKSyptWhubTOeAbecause Twitch returned HTTP 400. They ran version3b1983cb, which already recognizes documented ban-state messages, so the exact-message allowlist did not cover these responses. The provider body is redacted from logs; the exact rejection reason cannot be recovered.For an unban HTTP 400 with a valid, nonempty message, return callable
failed-preconditionwith a fixed generic rejection message when the existing specific messages do not match. This keeps a provider request rejection at HTTP 400 and informational request logging without exposing Twitch's raw message or assuming the user's ban state. Ban and timeout keep their existing classification. Malformed or empty responses, permission failures, transport errors, and provider 5xx errors retain error reporting.This deliberately treats all well-formed, nonempty unban 400 messages as rejections, including parameter rejection messages; the callable already requires a channel and target, resolves missing user IDs, and obtains the moderator ID from the linked profile.
Regression coverage checks fallback classification, redaction, logging severity, empty/malformed responses, and continued reporting of other failures.
Validation:
go vet ./...,CI=true TWITCH_CLI=/tmp/rtchat-twitch-cli/twitch go test -race ./..., formatting, andgit diff --check.Twitch API reference: https://dev.twitch.tv/docs/api/reference/#unban-user