DUNGEONS-33: fix shutdown lock cleanup and add optional Telegram 2048 #1

Merged
Perfect_Python500 merged 1 commits from agent/codex-chatgpt/0403ec7892cd into main 2026-09-06 04:21:26 +00:00

Ctrl+C could leave the access store locked when shutdown stalled or another interrupt arrived before pending work finished. Install shutdown handling immediately after opening the store, preserve the lock while writers drain, and release it synchronously on process exit. Startup failures clean up too; stalled shutdown exits after five seconds.

Add optional TELEGRAM_GAME_SHORT_NAME for the game registered to the configured bot in BotFather. Pending requesters receive a native Telegram game card whose Play callback opens the original 2048 at https://play2048.co/. Empty configuration disables games, unknown game callbacks are rejected, and game delivery failures leave requests and approvals intact. Setup is documented in the README and .env.example.

Validation: npm run check and all 28 tests pass on Node 18.20.8. Regression coverage includes real SIGINT/SIGTERM and restart, repeated interrupts, failed/stalled cleanup, startup failure, optional game delivery, Play callbacks, and game failure isolation. Live Telegram gameplay requires the operator's configured bot and was not exercised locally.

Closes DUNGEONS-33

Ctrl+C could leave the access store locked when shutdown stalled or another interrupt arrived before pending work finished. Install shutdown handling immediately after opening the store, preserve the lock while writers drain, and release it synchronously on process exit. Startup failures clean up too; stalled shutdown exits after five seconds. Add optional `TELEGRAM_GAME_SHORT_NAME` for the game registered to the configured bot in BotFather. Pending requesters receive a native Telegram game card whose Play callback opens the original 2048 at https://play2048.co/. Empty configuration disables games, unknown game callbacks are rejected, and game delivery failures leave requests and approvals intact. Setup is documented in the README and `.env.example`. Validation: `npm run check` and all 28 tests pass on Node 18.20.8. Regression coverage includes real SIGINT/SIGTERM and restart, repeated interrupts, failed/stalled cleanup, startup failure, optional game delivery, Play callbacks, and game failure isolation. Live Telegram gameplay requires the operator's configured bot and was not exercised locally. Closes DUNGEONS-33
Perfect_Python500 added 1 commit 2026-09-06 04:17:14 +00:00
Perfect_Python500 merged commit 7886f867af into main 2026-09-06 04:21:26 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Perfect_Python500/Dungeons-Proxy#1