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

Don't drop partially unsupported GTFS-RT messages #159

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

jbruechert
Copy link
Contributor

@jbruechert jbruechert commented Dec 11, 2024

Previously all messages containing unsupported fields like (alert or
vehicle) were ignored, even if they contained an understandable
trip_update.

Now all possible warnings are emitted, not just the first fatal one.

This commit also changes the debug output to show the names of the
relevant fields to make it easier to debug GTFS-RT feeds without looking
at the MOTIS source code.

@jbruechert
Copy link
Contributor Author

Apparently the specification recommends against sending multiple types of update in one message (public-transport/transitous#689 (comment)).
Does it still make sense to be lenient on the consumer side and leave interpreting the spec strictly to the producers, or should I reduce this PR to the logging changes?

@jbruechert jbruechert marked this pull request as draft December 11, 2024 11:19
@jbruechert jbruechert marked this pull request as ready for review December 11, 2024 11:33
@felixguendling
Copy link
Member

As long as there's only this one feed that is not standard conformant (and it seems like it can be changed) I would prefer to stick to the standard. So logging a warning message if the sum is != 1U would be sufficient IMO.

In case feeds we want to support but don't have any control over can be support with a small change, I would merge it.

@jbruechert
Copy link
Contributor Author

I ran this patch on the full Transitous dataset. us-ny-MetroNorth, fr-donnees-theoriques-et-temps-reel and fr-horaires-theoriques-et-temps-reels-du-reseau-de-transports-lagglo-en-bus-communaute-dagglomeration-gap-tallard-durance have the same problem, so this does appear in the real world

Previously all messages containing unsupported fields like (alert or
vehicle) were ignored, even if they contained an understandable
trip_update.

Now all possible warnings are emitted, not just the first fatal one.

This commit also changes the debug output to show the names of the
relevant fields to make it easier to debug GTFS-RT feeds without looking
at the MOTIS source code.
@felixguendling felixguendling merged commit f647fb6 into motis-project:master Dec 11, 2024
10 checks passed
@felixguendling
Copy link
Member

Thank you very much for checking all feeds! I refactored a bit to reduce redundancy (which was already there before, not your mistake). Thank you for the PR! It's included in the v2.0 release.

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.

2 participants