Skip to content

fix: stationBoard entries can be nullish#41

Merged
traines-source merged 1 commit intopublic-transport:mainfrom
121593:fix/empty-liveboard
Dec 15, 2025
Merged

fix: stationBoard entries can be nullish#41
traines-source merged 1 commit intopublic-transport:mainfrom
121593:fix/empty-liveboard

Conversation

@121593
Copy link
Copy Markdown
Contributor

@121593 121593 commented Dec 10, 2025

Station board sometimes returns {}, causing an error to be thrown when calling entries.flat().

Should I add a test ? If yes would it go in the .har ?

Copy link
Copy Markdown
Member

@traines-source traines-source left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Is it actually entries or one of the other fields that would have been expected for the profile you're using? Anyways, while it has the same effect, I think one could just always fall back to [].
If you have a case that reliably reproduces this, you could indeed add an integration test (see https://github.com/public-transport/db-vendo-client/blob/main/docs/tests.md#adding-integration-test-fixtures). If not, it's probably not worth the hassle and we'll just keep it as it is.

When no entries are present an error was thrown when calling `entries.flat()`
@121593 121593 force-pushed the fix/empty-liveboard branch from 74fa7b3 to e82e538 Compare December 11, 2025 16:41
@121593
Copy link
Copy Markdown
Contributor Author

121593 commented Dec 11, 2025

I didn't grabbed a full dump of the call, but text content from the response is a simple {}

@traines-source traines-source merged commit 3cfff6e into public-transport:main Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants