Open line72 opened 4 years ago
If the GTFS data is out of sync with the real time data, then I have seen errors where the route ids don't match. This leads to errors in the RTVehicleParser. We can fix this by updating the gtfs data, but we could also be more defensive and add in:
diff --git a/src/gtfs/RTVehicleParser.js b/src/gtfs/RTVehicleParser.js index 6f95825..07dbb4f 100644 --- a/src/gtfs/RTVehicleParser.js +++ b/src/gtfs/RTVehicleParser.js @@ -72,10 +72,14 @@ class RTVehicleParser { .then((routes) => { // insert the vehicle locations into the route. let updates = routes.rows.map((route) => { - return { - ...route.doc, - vehicles: vehicles[route.doc.rId] - }; + if (!!route.error) { + return {}; + } else { + return { + ...route.doc, + vehicles: vehicles[route.doc.rId] + }; + } }); return this.db.bulkDocs(updates);
If the GTFS data is out of sync with the real time data, then I have seen errors where the route ids don't match. This leads to errors in the RTVehicleParser. We can fix this by updating the gtfs data, but we could also be more defensive and add in: