Leaderboards: surface real submit error for diagnosis (plan 0005)#308
Merged
Conversation
The submit/refresh catches swallowed the underlying Supabase error, so a failed submit only showed a generic toast with nothing in the debug console. Log the error and include its message in the toast so the actual RLS/schema/constraint cause is visible for diagnosis. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RXC54QHvgfZce87ohuMHcz
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Coverage SummaryLines: 58.86% (6264/10642) · Statements: 57.79% · Functions: 56.1% · Branches: 53.82% Per-file coverage
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
lapwing | c9cf7e2 | Commit Preview URL Branch Preview URL |
Jun 26 2026, 04:27 AM |
lap_time_ms is an integer column but snap.lapTimeMs is fractional (derived from float sample timestamps), so Postgres rejected the insert with "invalid input syntax for type integer". Round it on the way in; add a regression test. The submit toast is restored to the friendly message (the raw error stays in console.error for diagnosis). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RXC54QHvgfZce87ohuMHcz
The engine powers leaderboard grouping and snapshot matching, so a vehicle must always carry one. Make it a required field in the vehicle form (guard + disabled submit + inline hint), and flag any pre-existing vehicle that has no engine with a warning in the list so members who set one up earlier are prompted to fix it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RXC54QHvgfZce87ohuMHcz
The read-only leaderboard viewer showed "–" for S1/S2/S3 because the transposed laps were built without sector data. Add computeLapSectors() — a single-lap sector calculator that anchors the lap at the sample-slice ends (no start/finish re-detection, since an entry's clean lap has no lead-in) and locates the intermediate sector-line crossings, mirroring calculateLaps' per-lap logic. buildLeaderboardSession now fills sectors/sectorTimes/sectorBoundaries per entry (boundaries offset into the concatenated array). Tests added for both. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RXC54QHvgfZce87ohuMHcz
…005)
Clicking an engine/weight class now expands a fourth accordion level: a ranked
"{rank} {name} {time}" list instead of immediately loading a session. Clicking a
single entry opens the read-only viewer for that one lap; a "Load top N laps as a
single session" button at the top of the list loads the multi-lap session
(honouring the Show-top selector). GroupNode now carries a fastest-first entries
list (id/name/time); page wires group-level expansion + single/top loaders.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RXC54QHvgfZce87ohuMHcz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the merged leaderboards PR. You're hitting a generic "couldn't submit — please try again" toast with nothing in the debug console, because the submit/refresh catch blocks swallowed the underlying Supabase error.
This logs the real error (
console.error/console.warn, so it shows in the?dbg=trueoverlay) and appends the message to the toast, so the next attempt reveals the actual cause (RLS violation vs. schema-cache miss vs. constraint).The insert matches the working
lap_snapshotspattern exactly and every column it sends exists in the migration, so the likely culprit is one of:NOTIFY pgrst, 'reload schema';in the Supabase SQL editor (the migration emits this, but the runner may not have triggered a reload).auth.uid()not matching (stale session).Once this is on beta, try a submit and tell me the message in the toast/console and I'll fix the root cause.
🤖 Generated with Claude Code
Generated by Claude Code