Skip to content

Infinite loop in sortAndFilterTrips #426

@evansiroky

Description

@evansiroky

Observed behavior (please include a screenshot if possible)

The sortAndFilterTrips in lib/editor/util/index.js will run in an infinite loop if one of the trips have an empty array of stop times.

Expected behavior

Infinite loop should be avoided.

Steps to reproduce the problem

While editing this GTFS file (gtfs_GL.zip) in the datatools-ui editor, I changed the service_id on the calendar entry. Then, I checked some stop times in the timetable and noticed that they are completely missing for the even numbered trips. In certain cases the only trips available for a certain service id were those that didn't have any stop_times. In those cases, the UI froze because an infinite loop was encountered while trying to sort the trips.

Any special notes on configuration used

Editor module must be enabled.

Version of datatools-ui and datatools-server if applicable (exact commit hash or branch name)

gtfs-lib: conveyal/gtfs-lib@5ec5285
datatools-server: ibi-group/datatools-server@5943dfb
datatools-ui: 0f10fa2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions