conveyal / gtfs-lib

A library for loading and saving GTFS feeds of arbitrary size with disk-backed storage
BSD 2-Clause "Simplified" License
71 stars 38 forks source link

Exported location group used in a schedule is flagged as unused. #359

Closed binh-dam-ibigroup closed 2 years ago

binh-dam-ibigroup commented 2 years ago

Observed behavior

Upon loading a feed zip with a location group used in a schedule, the validation results show that the location group is unused.

Expected behavior

The location group should not be flagged as unused.

Steps to reproduce the problem

  1. In the GTFS editor, create a location group, add it to a pattern of a route, and populate the schedule for that location group.
  2. Export and download a snapshot of the GTFS editor
  3. Create a new feed source and import the exported snapshot
  4. Observe the validation warning regarding the unused location group.

Notes on configuration and files required to reproduce the issue

Affected branch: dev-flex.

br648 commented 2 years ago

@binh-dam-ibigroup can I confirm that datatools-server and datatools-ui are both on branch dev-flex? I'm getting errors working off of these branches when attempting to edit a route:

New Route's route_id value (7sjh) conflicts with an existing record in table.

If I change the route id, I get this instead:

Validation error of type FieldUndefined: Field 'pattern_location_groups' in type 'pattern' is undefined @ 'feed/routes/patterns/pattern_location_groups'

cc @miles-grant-ibigroup

miles-grant-ibigroup commented 2 years ago

Are you creating/importing a new feed from scratch? We've had some issues adjusting older feeds as the database structure changes.

br648 commented 2 years ago

@miles-grant-ibigroup I'm attempting to create from scratch. New project and new feed source.

miles-grant-ibigroup commented 2 years ago

I just tried with a clean database and fresh branches and was unable to replicate. Did you run mvn clean? I've found that sometimes the wrong gtfs-lib version is loaded

br648 commented 2 years ago

yeah nevermind, did a clean and compile to resolve. Sorry about that!

br648 commented 2 years ago

@binh-dam-ibigroup Did you add a location to the location group? The download fails if I don't do this, which is something I'll need to address separately (NPE if there are no Location Groups). If I add the location and import the snapshot, I don't get the validation error.

br648 commented 2 years ago

@binh-dam-ibigroup validation errors I'm getting: image

binh-dam-ibigroup commented 2 years ago

Unable to reproduce after latest code update.