db-rest icon indicating copy to clipboard operation
db-rest copied to clipboard

v6: pagination not working due to realtime routing

Open debfx opened this issue 2 years ago • 4 comments

Pagination doesn't seem to be working with API v6.

For example https://v6.db.transport.rest/journeys?from=8096021&to=8000085&departure=2023-08-01 returns 3 results with the latest departure at 04:46.

Still both earlierRef and laterRef are null so it's not possible to do follow-up request for the next results.

API v5 https://v5.db.transport.rest/journeys?from=8096021&to=8000085&departure=2023-08-01 returns working earlierRef and laterRef.

debfx avatar Jun 26 '23 22:06 debfx

In hafas-client, the HAFAS client underlying v6.db.transport.rest & v5.db.transport.rest, I have changed the default rtMode (routing mode of the HAFAS engine) from "hybrid" routing to "realtime" routing: https://github.com/public-transport/hafas-client/commit/3c17678d. This change has been done in hafas-client@6 only, so that explains why the pagination is only broken in v6.db.transport.rest.

The ticket in the hafas-client repo proposes adding an option to hafas-clients's journey() method, which could then be exposed here in db-rest. Then, we should also clearly document the effects of the realtimeRouting option.

TLDR: blocked by https://github.com/public-transport/hafas-client/issues/287

derhuerst avatar Jun 27 '23 09:06 derhuerst

I have published the fix (#295) as [email protected]. 🎉

https://github.com/public-transport/hafas-client/issues/287#issuecomment-1649929463

This is unblocked now. What needs to be done here:

derhuerst avatar Aug 02 '23 11:08 derhuerst

Is there work in progress for this? If not, I might try looking into it, since it's affecting my usecase.

dancojocaru2000 avatar Sep 18 '23 07:09 dancojocaru2000

Is there work in progress for this?

None that I know of.

derhuerst avatar Feb 08 '24 10:02 derhuerst