fix: prevent partial DB writes on scorecard submission failure #79
No reviewers
Labels
No Label
ai-changes-requested
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
in-next-release
status/in-progress
status/pr-open
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-v2#79
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/scorecard-submission-resilience"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
#N/A)SheetsExceptionmessages through the error chain instead of wrapping them in generic "Unable to read pitching decisions"SheetsExceptionhandler that shows users the specific cell and error type instead of "An unexpected error occurred"Context
On 2026-03-10, a CLS vs MKE scorecard submission failed because the Pitcherstats tab had a
#N/Aformula error inteam_id(Row 4). The old code had already committed 74 plays and updated the game score before attempting to read pitching decisions — leaving the DB in a partial state. The user saw only: "An unexpected error occurred. Please try again or contact an admin."What changed
commands/league/submit_scorecard.py: Moved all three spreadsheet reads into a single Phase 6 before any DB writes (Phase 7-9). Addedexcept SheetsExceptionhandler with user-friendly detailed message.services/sheets_service.py: Addedexcept SheetsException: raiseinread_pitching_decisionsandread_box_scoreso detailed error messages aren't swallowed by the generic wrapper.Test plan
#N/Aformula error — verify no data written to DB and user sees detailed errorCloses #78
🤖 Generated with Claude Code
Remove the generic placeholder method from BaseService and replace the single call site in CustomCommandsService.get_or_create_creator with a direct client.post("custom_commands/creators", ...) call, consistent with how _update_creator_stats and _update_creator_info already work. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>Pull request closed