Problem
When two configured static feeds contain the same stop_id but assign it different latitude/longitude coordinates, mergeStaticAndDiscoverAgencies (internal/gtfs/gtfs_bundles.go:264-293) keeps the first occurrence and silently discards the second location.
Currently, only a Sentry warning is emitted.
This means the second physical stop becomes completely invisible to the system. In particular, its location cannot be used by:
- Bounding-box validation.
- Stop resolution.
- Other logic that relies on the merged stop lookup.
Current constraint
Until this is fixed, multi-feed configurations must not contain stop_id collisions.
In practice, configurations should use a static feed bundle that has already been merged outside Watchdog rather than relying on Watchdog to combine multiple per-agency feeds that may contain overlapping stop_ids.
Proposed fix
Instead of discarding the duplicate location, preserve the conflicting locations and make them available to the relevant processing paths.
The bbox-check and unmatched-stop resolution paths should then operate with the appropriate location and expose conflicts through per-(agency, stop_id) metrics where necessary.
This issue is also closely related to #137 : once bounding boxes become agency-specific, preserving the correct physical location for a colliding stop_id becomes even more important. A union-based stop lookup can only return one location for a duplicated ID, which can lead to incorrect agency-level bounding-box and stop-resolution behavior.
Problem
When two configured static feeds contain the same
stop_idbut assign it different latitude/longitude coordinates,mergeStaticAndDiscoverAgencies(internal/gtfs/gtfs_bundles.go:264-293) keeps the first occurrence and silently discards the second location.Currently, only a Sentry warning is emitted.
This means the second physical stop becomes completely invisible to the system. In particular, its location cannot be used by:
Current constraint
Until this is fixed, multi-feed configurations must not contain
stop_idcollisions.In practice, configurations should use a static feed bundle that has already been merged outside Watchdog rather than relying on Watchdog to combine multiple per-agency feeds that may contain overlapping
stop_ids.Proposed fix
Instead of discarding the duplicate location, preserve the conflicting locations and make them available to the relevant processing paths.
The bbox-check and unmatched-stop resolution paths should then operate with the appropriate location and expose conflicts through per-
(agency, stop_id)metrics where necessary.This issue is also closely related to #137 : once bounding boxes become agency-specific, preserving the correct physical location for a colliding
stop_idbecomes even more important. A union-based stop lookup can only return one location for a duplicated ID, which can lead to incorrect agency-level bounding-box and stop-resolution behavior.