Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leg id causes fare conflicts because of relay conventions #6222

Closed
vesameskanen opened this issue Nov 4, 2024 · 1 comment · Fixed by #6243
Closed

Leg id causes fare conflicts because of relay conventions #6222

vesameskanen opened this issue Nov 4, 2024 · 1 comment · Fixed by #6243
Assignees

Comments

@vesameskanen
Copy link
Contributor

Expected behavior

Leg fares can be queried using relay graphql client

Observed behavior

Relay changes conflicting fare ids thus breaking the fares

Version of OTP used (exact commit hash or JAR name)

otp-2.7.0-SNAPSHOT-shaded.jar

Data sets in use (links to GTFS and OSM PBF files)

Any GTFS with fares v1

Command line used to start OTP

Irrelevant

Router config and graph build config JSON

Irrelevant

Steps to reproduce the problem

Make itinerary search which requests leg id and fares, and where some itineraries share an identical transit leg:

itinerary1: TransitLegA - TransitLegB
itinerary2: TransitLegA - TransitLegC

Pull request #6045 added an id field to legs. Unfortunately a popular graphQl client Relay considers such a field name as an unique identifier for received data records. Two legs with same id must have identical content. However, otherwise identical legs may have different fares as the fares are computed independently for each itinerary. Relay considers this as a conflic state and changes the received fare information. Ticket information becomes unreliable/unusable.

Changing the leg identifier to something else - say legId - fixes the problem.

@vesameskanen
Copy link
Contributor Author

Use of graphQL alias for leg id fixes the issue.

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 a pull request may close this issue.

1 participant