Skip to content

Conversation

@reidzeibel
Copy link
Member

Fixes https://github.com/AtB-AS/kundevendt/issues/19814

Reference discussion: https://mittatb.slack.com/archives/C02EEG7D8EL/p1746604283420249

The message on the issue appears because there are inconsistencies between the result returned by the trip search and get single trip.

When we search trip by entering the address from-to, we get a list of trips. The first page of the trips list result is fetched using datetime parameter on the query. While the subsequent page is fetched using the pagecursor parameter on the query.

When we select a single trip to see the details, we fetch the details of this single trip using datetime parameter, therefore the result can be different.

This happens if we select a specific trip on the second page of result (using pagecursor), then the trip details will be fetched using datetime instead. Causing different results when fetching some queries (see reference chat on slack).

So the solution to fix this is to make the queries consistent across screens. For queries with pagecursor, fetch the details using that pagecursor, if it is not defined, use the datetime.

Feel free to let me know if you need more explanation!

@reidzeibel reidzeibel self-assigned this May 7, 2025
@rosvik
Copy link
Member

rosvik commented May 7, 2025

I'm not sure I understand why using datetime doesn't work here 🤔 I'm up for a huddle after 13 if you want @reidzeibel

Also, this makes me think: Could we use cursors to improve the single trip endpoint in general? Cursors are just base64 encoded strings (e.g. MnxORVhUX1BBR0V8MjAyNS0wNS0wOFQwODo0NTowMFp8fDNoMjBtfFNUUkVFVF9BTkRfQVJSSVZBTF9USU1FfHx8fHx8fA== which decodes to 2|NEXT_PAGE|2025-05-08T08:45:00Z||3h20m|STREET_AND_ARRIVAL_TIME|||||||), which means we can create our own cursors even in cases where the trip suggestion was on the first page.

@reidzeibel
Copy link
Member Author

I'm not sure either why datetime doesn't work, but that happens in our current app if you try searching the same trip (Frosta skole-Åsen stasjon)

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.

3 participants