From d9b59c1a92e51878f4cffbc6e6388750c7087d3c Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Tue, 12 Dec 2023 12:00:40 +0100 Subject: [PATCH 1/2] Use TRIP_NOT_FOUND --- .../opentripplanner/ext/siri/SiriTimetableSnapshotSource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ext/java/org/opentripplanner/ext/siri/SiriTimetableSnapshotSource.java b/src/ext/java/org/opentripplanner/ext/siri/SiriTimetableSnapshotSource.java index eab0496c4f2..345f8deba20 100644 --- a/src/ext/java/org/opentripplanner/ext/siri/SiriTimetableSnapshotSource.java +++ b/src/ext/java/org/opentripplanner/ext/siri/SiriTimetableSnapshotSource.java @@ -4,7 +4,7 @@ import static org.opentripplanner.updater.spi.UpdateError.UpdateErrorType.NOT_MONITORED; import static org.opentripplanner.updater.spi.UpdateError.UpdateErrorType.NO_FUZZY_TRIP_MATCH; import static org.opentripplanner.updater.spi.UpdateError.UpdateErrorType.NO_START_DATE; -import static org.opentripplanner.updater.spi.UpdateError.UpdateErrorType.NO_TRIP_ID; +import static org.opentripplanner.updater.spi.UpdateError.UpdateErrorType.TRIP_NOT_FOUND; import static org.opentripplanner.updater.spi.UpdateError.UpdateErrorType.TRIP_NOT_FOUND_IN_PATTERN; import static org.opentripplanner.updater.spi.UpdateError.UpdateErrorType.UNKNOWN; @@ -325,7 +325,7 @@ private Result handleModifiedTrip( trip = tripAndPattern.trip(); pattern = tripAndPattern.tripPattern(); } else { - return UpdateError.result(null, NO_TRIP_ID); + return UpdateError.result(null, TRIP_NOT_FOUND); } Timetable currentTimetable = getCurrentTimetable(pattern, serviceDate); From 808a0de9d9ee9292ce498da6077a802338fbefa7 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 13 Dec 2023 09:37:27 +0100 Subject: [PATCH 2/2] Don't process Siri feed without service delivery --- .../ext/siri/updater/SiriETHttpTripUpdateSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext/java/org/opentripplanner/ext/siri/updater/SiriETHttpTripUpdateSource.java b/src/ext/java/org/opentripplanner/ext/siri/updater/SiriETHttpTripUpdateSource.java index 9dab72446ea..b3abe95dfc2 100644 --- a/src/ext/java/org/opentripplanner/ext/siri/updater/SiriETHttpTripUpdateSource.java +++ b/src/ext/java/org/opentripplanner/ext/siri/updater/SiriETHttpTripUpdateSource.java @@ -49,7 +49,7 @@ public Optional getUpdates() { long t1 = System.currentTimeMillis(); try { var siri = siriLoader.fetchETFeed(requestorRef); - if (siri.isEmpty()) { + if (siri.map(Siri::getServiceDelivery).isEmpty()) { return Optional.empty(); }