Issue #4 from code review - multi-step database operations were not wrapped in transactions, risking partial state on failure. Changes: - Modified save_play() and update_game_state() in DatabaseOperations to accept optional session parameter for transaction grouping - Wrapped resolve_play() DB operations in single atomic transaction - Wrapped resolve_manual_play() DB operations in single atomic transaction - Transaction commits atomically or rolls back entirely on failure Pattern: When session provided, use flush() for IDs without committing; caller controls transaction. When no session, create internal transaction. All 739 unit tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .claude | ||
| .git-hooks | ||
| alembic/versions | ||
| app | ||
| scripts | ||
| terminal_client | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .python-version | ||
| CLAUDE.md | ||
| clean_test_data.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| mypy.ini | ||
| pyproject.toml | ||
| pyrightconfig.json | ||
| pytest.ini | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
| TEST_COVERAGE_SUMMARY.md | ||
| test_db_playground.py | ||
| test_pd_api_live.py | ||
| test_pd_api_mock.py | ||
| test_redis_cache.py | ||
| uv.lock | ||
Paper Dynasty Backend
FastAPI-based real-time baseball game engine with WebSocket support.
Quick Start
# Install UV
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync
# Run server
uv run python -m app.main
Documentation
See CLAUDE.md for full documentation.