Skip to content

Handle Twitch unban rejections without internal error alerts - #1747

Merged
kevmo314 merged 1 commit into
mainfrom
fix/twitch-unban-provider-errors
Oct 29, 2026
Merged

kevmo314 merged 1 commit into
mainfrom
fix/twitch-unban-provider-errors

Conversation

@kevmo314

Copy link
Copy Markdown
Contributor

Two authenticated Twitch /unban requests at 2026-10-29 11:41:47 and 11:41:49 UTC returned HTTP 500/INTERNAL and created Error Reporting group CKSyptWhubTOeA because Twitch returned HTTP 400. They ran version 3b1983cb, 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-precondition with 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, and git diff --check.

Twitch API reference: https://dev.twitch.tv/docs/api/reference/#unban-user

@kevmo314
kevmo314 merged commit bcfa626 into main Oct 29, 2026
8 checks passed
@kevmo314
kevmo314 deleted the fix/twitch-unban-provider-errors branch October 29, 2026 11:59
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