Skip to content

fix: Persistence on startup#21

Merged
antonykamp merged 1 commit intomasterfrom
antonykamp/fix-persistent
Mar 20, 2026
Merged

fix: Persistence on startup#21
antonykamp merged 1 commit intomasterfrom
antonykamp/fix-persistent

Conversation

@antonykamp
Copy link
Copy Markdown
Owner

Summary

This pull request introduces a small but important improvement to the way conversation states are loaded from the database in quizbot/bot/persistence.py. The change ensures that non-integer states are handled gracefully, preventing potential errors when parsing state values.

  • Improved state parsing logic in the _load function: Added a _parse_state helper that attempts to convert row.state to an integer, but returns the original value if conversion fails, allowing for non-integer states to be handled without raising exceptions.

@antonykamp antonykamp self-assigned this Mar 20, 2026
@antonykamp antonykamp merged commit 45d15c3 into master Mar 20, 2026
7 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.14%. Comparing base (19c49ef) to head (0ebadf4).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
quizbot/bot/persistence.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
- Coverage   86.35%   86.14%   -0.21%     
==========================================
  Files          10       10              
  Lines         623      628       +5     
==========================================
+ Hits          538      541       +3     
- Misses         85       87       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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