Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -606,12 +606,12 @@ private boolean clearEntriesForRealtimeAddedTrips(String feedId) {
}

/**
* Add the patterns to the stop index, only if they come from a modified pattern
* Add patterns to the stop index for patterns created by realtime updaters.
* This ensures that realtime-added trips (like SIRI ET ExtraJourneys) appear in
* departure board queries at stops.
*/
private void addPatternToIndex(TripPattern tripPattern) {
if (tripPattern.isCreatedByRealtimeUpdater()) {
//TODO - SIRI: Add pattern to index?

for (var stop : tripPattern.getStops()) {
patternsForStop.put(stop, tripPattern);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ Result<TripUpdate, UpdateError> build() {
.withNetexSubmode(trip.getNetexSubMode())
.withStopPattern(stopPattern)
.withScheduledTimeTableBuilder(builder -> builder.addTripTimes(tripTimes))
.withCreatedByRealtimeUpdater(true)
.build();

RealTimeTripTimesBuilder builder = tripTimes.createRealTimeFromScheduledTimes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.opentripplanner.transit.model._data.FeedScopedIdForTestFactory.id;
import static org.opentripplanner.updater.spi.UpdateResultAssertions.assertFailure;

Expand Down Expand Up @@ -79,6 +80,20 @@ void testAddJourneyWithExistingRoute() {
transitService.findPatterns(route).size(),
"The added trip should use a new pattern for this route"
);

// Verify ExtraJourney appears in departure board (#7008)
var expectedPattern = transitService.findPattern(trip);
var patternsAtStopC = transitService.findPatterns(STOP_C, true);
assertTrue(
patternsAtStopC.contains(expectedPattern),
"ExtraJourney pattern should appear in patterns for stop C (departure board)"
);

var patternsAtStopD = transitService.findPatterns(STOP_D, true);
assertTrue(
patternsAtStopD.contains(expectedPattern),
"ExtraJourney pattern should appear in patterns for stop D (arrival board)"
);
}

@Test
Expand Down
Loading