Skip to content

fix: accept status text as an OpenF1 session result position - #60

Merged
JustMaris merged 2 commits into
mainfrom
fix/session-result-string-position
Oct 10, 2026
Merged

JustMaris merged 2 commits into
mainfrom
fix/session-result-string-position

Conversation

@JustMaris

@JustMaris JustMaris commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

OpenF1's session_result can return position as a string (e.g. "RT" for a driver who set no time) instead of an integer. Decoding it into *int failed the whole result list, so /f1/latest_session/ fell back to the previous session and reported the new one as "not available yet", indefinitely.

Seen on the 2026 Singapore qualifying (session 11384, driver 6): OpenF1 had all 22 results, but the API kept serving the Sprint Race with pending: Qualifying.

  • position now accepts a number, null or a string (sessionPosition).
  • A status string is used as the time cell when the driver has no time.
  • The fallback response keeps upstream_error, which was dropped before and hid the real cause.
  • Tests cover number/null/string positions and upstream_error on the fallback.

OpenF1 reports position as a string (e.g. "RT") for a driver with no time.
Decoding it into *int failed the whole session_result list, so the latest
session fell back to the previous one with a misleading "results not
available yet" note. Accept a number, null or a status string, and show the
status text in the time column when there is no time.
When the newest session's results can't be fetched, the response falls back
to the previous session but dropped the error that explained why, so the
widget just said results weren't available yet. Carry upstream_error over so
the cause is visible.
@JustMaris
JustMaris marked this pull request as ready for review October 10, 2026 19:25
@JustMaris
JustMaris merged commit ffcc2ce into main Oct 10, 2026
6 checks passed
@JustMaris
JustMaris deleted the fix/session-result-string-position branch October 10, 2026 19:25
@dnb-robot dnb-robot Bot mentioned this pull request Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant