Repository navigation
fix: **Keep the starting grid correct when the feed duplicates a grid position** - #811
Conversation
… position** The live TimingAppData feed for the 2026 Singapore Sprint sent car 1 GridPos 1 while it lined up 5th, so the confirmed grid showed two P1s and no P5. When a GridPos is shared, use the car's pre-start Line if that slot is otherwise empty. Line is only recorded while the session is Inactive, since afterwards it is the running order.
|
I can reproduce the reported duplicate grid position, but the fix does not handle the actual sequence in the Singapore Sprint Car 1 first receives Could you retain pre-start |
The Singapore Sprint feed moved car 1 to Line 5 in a delta without GridPos, which was skipped, so the duplicate fallback still saw Line 1.
|
Thanks a lot for digging into the raw stream and attaching it. You're right, and that was my miss. I had diagnosed the bug from a REST snapshot taken before the session. In a snapshot each car's The new commit keeps pre-start |
|
Thank you for you contribution |
Description
The live
TimingAppDatafeed can send the sameGridPosfor two cars. Before the 2026 Singapore Sprint (snapshot read 2026-10-10 ~10:45 CEST,SessionStatus: Inactive), car 1 (NOR) lined up 5th but was sentGridPos "1":{"1": {"RacingNumber": "1", "Line": 5, "GridPos": "1"}} {"3": {"RacingNumber": "3", "Line": 1, "GridPos": "1"}}The other 20 cars had
GridPos == Line. The starting-grid sensor trustedGridPos, so the confirmed grid showed NOR P1 (Δ -4) next to VER P1, and no P5. The official F1 app showed the correct order.StartingGridCoordinatornow stores each car'sLinenext to itsGridPos. A car whoseGridPosis shared by another car falls back to thatLine, but only when no other car'sGridPosalready claims the slot.Lineis recorded only while the session status isInactive, and is frozen once the session starts. After the start it is the running order, and a reconnect snapshot or a cold start mid-race would otherwise reshuffle the grid. If no pre-startLinewas seen, the grid stays as it is today.Related issue
No issue filed; observed live during the 2026 Singapore Sprint weekend.
Type of change
How has this been tested?
test_duplicate_gridpos_falls_back_to_pre_start_line. It covers the duplicate fallback, a GridPos-only delta after the start, and a mid-race reconnect snapshot with new Lines. It fails ondev.test_duplicate_gridpos_ignores_line_without_pre_start_status, for a cold start mid-race with no session status.scripts/run_ci_tests.py: 1676 passed, 6 deselected, line coverage 96.5%.Lineequals itsGridPos, including the 15 sessions where the grid differs from qualifying (penalties, back-of-grid starts). No archived session had a duplicateGridPos.Checklist
ruff formatandruff check)