Pulling master over to main #3

Merged
cal merged 6 commits from master into main 2026-02-04 06:16:30 +00:00
Owner
No description provided.
cal added 4 commits 2026-02-04 06:09:30 +00:00
Adds idempotency guard to prevent race conditions when multiple users
submit commands for the same play simultaneously.

Changes:
- Add PlayLockedException for locked play detection
- Implement lock check in checks_log_interaction()
- Acquire lock (play.locked = True) before processing commands
- Release lock (play.locked = False) after play completion
- Add warning logs for rejected duplicate submissions
- Add /diagnostics endpoint to health server for debugging

This prevents database corruption and duplicate processing when users
spam commands like "log xcheck" while the first is still processing.

Tested successfully in Discord - duplicate commands now properly return
PlayLockedException with instructions to wait.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sends instant notifications to Discord when the bot restarts, helping
track stability issues and auto-recovery events.

Changes:
- Add notify_restart.py script to send webhook notifications
- Integrate notification into bot startup (on_ready event)

The notification includes:
- Timestamp of restart (CST)
- Reason (healthcheck failure detection)
- Reference to diagnostics logs

Configuration:
Set RESTART_WEBHOOK_URL environment variable in docker-compose.yml
to enable notifications.

This provides immediate visibility when Docker auto-restarts the bot
due to crashes or healthcheck failures.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Discord webhooks require a User-Agent header or they return 403 Forbidden.
Added 'Paper-Dynasty-Discord-Bot/1.0' as User-Agent.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed from 'Auto-Restarted' to 'Restarted' and made the message
generic since the bot restarts for multiple reasons (manual, deployment,
healthcheck) - not just healthcheck failures.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
cal added 1 commit 2026-02-04 06:09:48 +00:00
Merge branch 'main' into master
All checks were successful
/ build (pull_request) Successful in 1m1s
8ff9cc02e7
cal added 1 commit 2026-02-04 06:13:39 +00:00
Update .gitea/workflows/docker-build.yml
All checks were successful
/ build (pull_request) Successful in 2m9s
63ea86f35a
cal merged commit 61a0ad60ba into main 2026-02-04 06:16:30 +00:00
cal deleted branch master 2026-02-04 06:16:31 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-discord#3
No description provided.