Title: fix: complete state persistence implementation with enhanced testing infrastructure by offendingcommit · Pull Request #15 · offendingcommit/commit-bingo · GitHub
Open Graph Title: fix: complete state persistence implementation with enhanced testing infrastructure by offendingcommit · Pull Request #15 · offendingcommit/commit-bingo
X Title: fix: complete state persistence implementation with enhanced testing infrastructure by offendingcommit · Pull Request #15 · offendingcommit/commit-bingo
Description: Summary This PR completes the implementation of server-side state persistence for the Bingo application, replacing the unreliable client-side app.storage.general with a robust StateManager that persists to game_state.json. This fixes #13 - App restarts lose game state. Background The app was previously using NiceGUI's app.storage.general which is just a wrapper around browser localStorage. This caused several issues: State was lost on server restarts Each browser had its own separate state No persistence across hot reloads during development Race conditions with concurrent users Solution Implemented 1. StateManager Pattern (src/core/state_manager.py) Server-side file persistence to game_state.json Atomic file writes using temp file + rename pattern Thread-safe with asyncio locks Debounced saves (100ms) for performance Graceful corruption recovery 96% test coverage 2. Enhanced Testing Infrastructure Added 79 new unit tests across 4 test suites Implemented pytest markers for test categorization Created progressive test targets (unit → integration → e2e) Optimized CI pipeline from 2+ minutes to ~7 seconds 3. CI/CD Improvements Excluded slow/flaky tests from CI while keeping them for local runs Added proper test markers (@pytest.mark.unit, @pytest.mark.slow, etc.) Fixed import sorting issues with isort Enhanced Makefile with multiple test targets Changes Overview 6,824 additions, 269 deletions across 49 files Core implementation in src/core/state_manager.py Updated app.py and game_logic.py to use StateManager Comprehensive test suites for all components Documentation updates in CLAUDE.md Added game_state.json to .gitignore Test Results ✅ 165 total tests ✅ 139 reliable tests run in CI (~7 seconds) ✅ 96% coverage for StateManager ✅ All unit tests pass in <100ms each Key Features Backward Compatibility: Existing game logic continues to work Hot Reload Support: State persists across development reloads Concurrent Access: Thread-safe operations with proper locking Error Recovery: Handles corrupted/missing state files gracefully Performance: Debounced saves prevent excessive I/O Breaking Changes None - the implementation maintains full backward compatibility. Checklist Tests pass locally Code follows project style guidelines (black, isort) Documentation updated No breaking changes CI pipeline optimized
Open Graph Description: Summary This PR completes the implementation of server-side state persistence for the Bingo application, replacing the unreliable client-side app.storage.general with a robust StateManager that per...
X Description: Summary This PR completes the implementation of server-side state persistence for the Bingo application, replacing the unreliable client-side app.storage.general with a robust StateManager that per...
Opengraph URL: https://github.com/offendingcommit/commit-bingo/pull/15
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cc3e40ea-ea26-d152-ffd9-3052b30419f9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D9F0:3FFC2D:AE3958:EB1060:698E3EA1 |
| html-safe-nonce | 1e34a835fd34e1850505501f05dc435c86af843496937f8d76b0cfd76fd6c4aa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUYwOjNGRkMyRDpBRTM5NTg6RUIxMDYwOjY5OEUzRUExIiwidmlzaXRvcl9pZCI6IjY2NTU2NTc1MDMyMTEwMTE3NDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 89619f54d50d560928778eb385edfe490437f9d8fab0e46bfa57fd5c7ad74fe9 |
| hovercard-subject-tag | pull_request:2621290625 |
| github-keyboard-shortcuts | repository,commits,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/offendingcommit/commit-bingo/pull/15/files |
| twitter:image | https://avatars.githubusercontent.com/u/215295392?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/215295392?s=400&v=4 |
| og:image:alt | Summary This PR completes the implementation of server-side state persistence for the Bingo application, replacing the unreliable client-side app.storage.general with a robust StateManager that per... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a5632af64f7fed7bff1d6a428d1aca1b94fa7a48f760de2d39d9b1effdbf0082 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/offendingcommit/commit-bingo git https://github.com/offendingcommit/commit-bingo.git |
| octolytics-dimension-user_id | 215295392 |
| octolytics-dimension-user_login | offendingcommit |
| octolytics-dimension-repository_id | 929999177 |
| octolytics-dimension-repository_nwo | offendingcommit/commit-bingo |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 929999177 |
| octolytics-dimension-repository_network_root_nwo | offendingcommit/commit-bingo |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | aa1fa9100f85cd8b602c63c7e337f9151e70024f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width