brackt/app/routes
Chris Parsons a054247a55
Fix standings snapshot upsert: atomic writes, correct date, and event-driven updates (#177)
- Add unique index on (team_id, season_id, snapshot_date) in team_standings_snapshots
  so concurrent writes can't produce duplicate rows (migration 0051)
- Rewrite createDailySnapshot to use INSERT ... ON CONFLICT DO UPDATE inside a
  transaction, replacing the SELECT-then-insert/skip pattern (N+1 queries, race-prone)
- Remove early-exit guard in server/snapshots.ts background job so it always
  upserts rather than skipping seasons that already have a snapshot for today
- Call createDailySnapshot in recalculateAffectedLeagues after recalculateStandings,
  so every bracket score update refreshes today's snapshot; wrapped in try/catch so
  a snapshot failure can't block Discord notifications
- Also call createDailySnapshot from the admin rescore and finalize-bracket actions
- Fix UTC date bug: replace toISOString().split('T')[0] with local date parts in
  both standings.ts and server/snapshots.ts (and the 7-day lookback query)
- Convert all dynamic await import() calls in bracket.server.ts to static imports

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 22:15:28 -07:00
..
api Optimize user data fetching with batch queries and centralize display name logic (#176) 2026-03-18 16:46:07 -07:00
leagues Optimize user data fetching with batch queries and centralize display name logic (#176) 2026-03-18 16:46:07 -07:00
teams feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin._index.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.data-sync.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.participants.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.events.$eventId.bracket.server.ts Fix standings snapshot upsert: atomic writes, correct date, and event-driven updates (#177) 2026-03-18 22:15:28 -07:00
admin.sports-seasons.$id.events.$eventId.bracket.tsx Fix partial bracket scoring, rank labels, and Discord notification bugs (#158) 2026-03-17 12:34:10 -07:00
admin.sports-seasons.$id.events.$eventId.server.ts Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
admin.sports-seasons.$id.events.$eventId.tsx Fix event date timezone bugs (UTC rollover + same-day status) (#148) 2026-03-15 12:28:39 -07:00
admin.sports-seasons.$id.events.server.ts Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
admin.sports-seasons.$id.events.tsx Fix event date timezone bugs (UTC rollover + same-day status) (#148) 2026-03-15 12:28:39 -07:00
admin.sports-seasons.$id.expected-values.server.ts Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
admin.sports-seasons.$id.expected-values.tsx Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
admin.sports-seasons.$id.futures-odds.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.participants.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.simulate.tsx Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
admin.sports-seasons.$id.standings.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.tsx Fix standings snapshot upsert: atomic writes, correct date, and event-driven updates (#177) 2026-03-18 22:15:28 -07:00
admin.sports-seasons.new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports.$id.tsx Add NHL playoff simulator and fix simulator dropdown (#166) 2026-03-18 01:23:53 -07:00
admin.sports.new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.standings-snapshots.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.templates.$id.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.templates.new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.templates.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
api.admin.export-sports-data.ts feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
home.tsx Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
how-to-play.tsx Add rules page, rewrite how-to-play, and fix scoring display (#20) 2026-02-21 21:58:51 -08:00
i.$inviteCode.tsx Optimize user data fetching with batch queries and centralize display name logic (#176) 2026-03-18 16:46:07 -07:00
rules.tsx Add rules page, rewrite how-to-play, and fix scoring display (#20) 2026-02-21 21:58:51 -08:00
test-socket.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
user-profile.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00