Skip to content

Improve game interaction handling#137

Merged
iqnite merged 7 commits into
mainfrom
stabler-timeouts
May 11, 2026
Merged

Improve game interaction handling#137
iqnite merged 7 commits into
mainfrom
stabler-timeouts

Conversation

@iqnite
Copy link
Copy Markdown
Owner

@iqnite iqnite commented May 9, 2026

Co-authored-by: Copilot copilot@github.com

Makes timeout and interaction handlign stabler and adds more exception handling and logging.

Should address several recent "Unauthorized (error code: 50027): Invalid Webhook Token" messages in the logs.

Co-authored-by: Copilot <copilot@github.com>
@iqnite iqnite added the bug Something isn't working label May 9, 2026
@iqnite iqnite requested a review from Copilot May 9, 2026 21:44
@iqnite iqnite self-assigned this May 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make Discord interaction handling more resilient during long-running gameplay (especially timeouts), reducing failures related to expired/invalid interaction tokens and improving logging around unexpected runtime errors.

Changes:

  • Run Game.start() in a background task from the start-game interaction to avoid blocking the interaction flow.
  • Add a fallback in Game.send() to post to the channel when an interaction respond fails with “Invalid Webhook Token” (401 / code 50027).
  • Add an async unit test covering the invalid-webhook-token fallback behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/test_core.py Adds an async test verifying Game.send() falls back to channel.send() on invalid interaction webhook token.
eggsplode/ui/start.py Starts the game in a background task and logs unhandled exceptions during game execution.
eggsplode/core.py Wraps interaction response sending with handling for invalid webhook token and falls back to sending via the channel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread eggsplode/ui/start.py
Comment thread eggsplode/core.py Outdated
@iqnite iqnite marked this pull request as ready for review May 11, 2026 13:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread eggsplode/ui/start.py
Comment thread eggsplode/core.py Outdated
@iqnite iqnite enabled auto-merge May 11, 2026 14:32
@iqnite iqnite merged commit b255f82 into main May 11, 2026
5 checks passed
@iqnite iqnite deleted the stabler-timeouts branch May 11, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants