Skip to content

Conversation

@t2gran
Copy link
Member

@t2gran t2gran commented Nov 14, 2025

Summary

SIRI ET ExtraJourney trips (real-time added trips) were successfully created and could be queried directly by trip ID, but they did not appear in departure/arrival board queries at stops. This PR fixes the issue by ensuring ExtraJourney patterns are properly indexed for stop-based queries.

THIS PR NEEDS TO BE DISCUSSED - I DISCUSSED THIS WITH VINCENT AND WE ARE NOT 100% SURE THIS IS THE RIGHT FIX.

Issue

Fixes #7008

Root Cause

The AddedTripBuilder created TripPattern objects for ExtraJourneys without setting the createdByRealtimeUpdater flag. This caused TimetableSnapshot.addPatternToIndex() to skip indexing these patterns in the patternsForStop multimap, which is used by departure board queries.

Code Flow

  1. Departure board query → StopTimesHelper.getTripTimesForStop()
  2. Calls transitService.findPatterns(stop, true) (with realtime flag)
  3. DefaultTransitService.findPatterns()timetableSnapshot.getPatternsForStop(stop)
  4. Returns patterns from patternsForStop multimap
  5. Problem: ExtraJourney patterns were never added to this index

Why the flag matters

// TimetableSnapshot.java:608-619
private void addPatternToIndex(TripPattern tripPattern) {
  if (tripPattern.isCreatedByRealtimeUpdater()) {  // ← ExtraJourneys returned FALSE
    for (var stop : tripPattern.getStops()) {
      patternsForStop.put(stop, tripPattern);  // ← Never executed for ExtraJourneys
    }
  }
}

@t2gran t2gran added this to the 2.9 (next release) milestone Nov 14, 2025
@t2gran t2gran requested a review from a team as a code owner November 14, 2025 00:30
@t2gran t2gran added !Bug Apply to issues describing a bug and PRs witch fixes it. +Real-Time The issue/PR is related to RealTime updates Entur Test This is currently being tested at Entur labels Nov 14, 2025
@vpaturet vpaturet removed the Entur Test This is currently being tested at Entur label Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it. +Real-Time The issue/PR is related to RealTime updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trips added in realtime-data (SIRI ET ExtraJourneys) do not appear in departure-/arrival boards

3 participants