fix: prevent partial DB writes on scorecard submission failure #79

Closed
cal wants to merge 12 commits from fix/scorecard-submission-resilience into next-release

12 Commits

Author SHA1 Message Date
Cal Corum
877bb9afde fix: prevent partial DB writes and show detailed errors on scorecard submission failure
Read all spreadsheet data (plays, box score, pitching decisions) before any
database writes so formula errors like #N/A don't leave the DB in a partial
state. Also preserve SheetsException detail through the error chain and show
users the specific cell/error instead of a generic failure message.

Closes #78

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:53:50 -05:00
cal
9ba0713887 Merge pull request 'fix: trailing slash on all collection POST calls' (#75) from fix/trailing-slash-307-redirect into main
All checks were successful
Build Docker Image / build (push) Successful in 51s
Reviewed-on: #75
2026-03-10 00:42:16 +00:00
Cal Corum
ba55ed3109 fix: add trailing slashes to all collection POST calls
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m16s
Ensures all client.post() calls to collection endpoints include
trailing slashes, matching the standardized database API routes.
Covers BaseService.create(), TransactionService, InjuryService,
and DraftListService POST calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:34:36 -05:00
cal
269429254f Merge pull request 'fix: targeted trailing slashes for POST endpoints (hotfix)' (#74) from fix/trailing-slash-307-redirect into main
All checks were successful
Build Docker Image / build (push) Successful in 52s
Reviewed-on: #74
2026-03-09 22:52:29 +00:00
Cal Corum
f6a25aa16d fix: use targeted trailing slashes instead of universal (hotfix)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m7s
Reverts universal trailing slash in _build_url which broke custom_commands
endpoints (401 on /execute/). Instead, add trailing slashes only to the
two batch POST endpoints (plays/, decisions/) that need them to avoid
307 redirects dropping request bodies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:50:58 -05:00
cal
52ab92523c Merge pull request 'fix: add trailing slashes to prevent 307 redirects dropping POST bodies' (#73) from fix/trailing-slash-307-redirect into main
All checks were successful
Build Docker Image / build (push) Successful in 53s
Reviewed-on: #73
2026-03-09 22:26:52 +00:00
Cal Corum
9379ba587a fix: add trailing slashes to API URLs to prevent 307 redirects dropping POST bodies
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m13s
The FastAPI server returns 307 redirects for URLs without trailing slashes.
aiohttp follows these redirects but converts POST to GET, silently dropping
the request body. This caused play-by-play and decision data from
/submit-scorecard to never be persisted to the database despite the API
returning success.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:25:08 -05:00
cal
b3b8cd9683 Merge pull request 'fix: show validation errors in trade embed Quick Status' (#70) from fix/trade-embed-errors-and-cleanup into main
All checks were successful
Build Docker Image / build (push) Successful in 50s
Reviewed-on: #70
2026-03-08 16:29:06 +00:00
Cal Corum
58fe9f22de fix: trade validation now checks against next week's projected roster
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m5s
validate_trade() was passing next_week=None to each team's
validate_transaction(), which skipped load_existing_transactions()
entirely. Trades were validated against the current roster only,
ignoring pending /dropadd transactions for next week.

Now auto-fetches current week from league_service and passes
next_week=current_week+1, matching /dropadd validation behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:27:03 +00:00
Cal Corum
e98a658fde fix: show actual validation errors in trade embed Quick Status
Quick Status previously only showed "X errors found" with no details.
Now lists each error and suggestion inline. Also stripped all emoji
from embed titles, field names, values, buttons, and messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:27:03 +00:00
cal
111a6cf338 Merge pull request 'fix: replace create_item_in_table placeholder with direct endpoint call (#30)' (#69) from ai/major-domo-v2#30 into main
All checks were successful
Build Docker Image / build (push) Successful in 57s
Reviewed-on: #69
2026-03-07 03:25:08 +00:00
Cal Corum
18ae65a8e2 fix: replace create_item_in_table placeholder with direct endpoint call (#30)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m10s
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>
2026-03-06 14:04:05 -06:00