Skip to content

fix: WAL mode, results post UX, proactive session cleanup#129

Merged
adrunkhuman merged 1 commit intomasterfrom
fix/issues-87-91-119
Mar 21, 2026
Merged

fix: WAL mode, results post UX, proactive session cleanup#129
adrunkhuman merged 1 commit intomasterfrom
fix/issues-87-91-119

Conversation

@adrunkhuman
Copy link
Owner

Summary

Bonus fix (no issue): cog_unload() is never called on Bot subclasses — it's a Cog lifecycle hook. This was pre-existing dead code; task cancellations were silently never running. Replaced with async def close() which awaits task cancellation before teardown, and added before_loop guards on both tasks so they wait until ready.

Test plan

  • uv run pytest — 272 passed, 1 skipped
  • Manual: press YES/NO on /admin results post confirm view — single message, no double-error on send failure
  • Manual: sqlite3 typer.db "PRAGMA journal_mode;" returns wal after first startup
  • Manual: check logs for Session cleanup removed N expired DM session(s) after sessions age out

Closes #87
Closes #91
Closes #119

🤖 Generated with Claude Code

…119)

- Enable SQLite WAL mode in Database.initialize() with fallback warning
- Fix PostResultsConfirmView buttons to separate interaction ack from
  channel.send so a send failure uses followup instead of double-messaging
- Add WorkflowStateStore.cleanup_all_expired() covering all session and
  cooldown dicts; wired to a new 5-minute background task
- Fix pre-existing dead code: cog_unload() is not called on Bot subclasses;
  replaced with async close() that also awaits task cancellation before
  shutting down
- Add before_loop guards on both background tasks so they wait until ready

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@railway-app railway-app bot temporarily deployed to patient-quietude / matchday-typer-pr-129 March 21, 2026 19:46 Destroyed
@railway-app
Copy link

railway-app bot commented Mar 21, 2026

🚅 Deployed to the matchday-typer-pr-129 environment in patient-quietude

Service Status Web Updated (UTC)
matchday-typer ✅ Success (View Logs) Mar 21, 2026 at 7:47 pm

@adrunkhuman adrunkhuman merged commit bbf965d into master Mar 21, 2026
3 checks passed
@adrunkhuman adrunkhuman deleted the fix/issues-87-91-119 branch March 21, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant