Skip to content

Fix: Arrival status condition - #187

Closed
kathryntanardy wants to merge 1 commit into
mainfrom
fix_186_incorrect-bus-status
Closed

kathryntanardy wants to merge 1 commit into
mainfrom
fix_186_incorrect-bus-status

Conversation

@kathryntanardy

Copy link
Copy Markdown
Contributor

Close #186

Fix for the TransLink bus status logic so buses are only marked Arrived once their realtime departure time has passed, with a 60-second grace window. Future buses now remain Delayed or OnTime based on delay.

@jbriones1

Copy link
Copy Markdown
Contributor

This will need to be investigated more and we'll see if we even need to fix it. A bus is marked "Arrived" when:

  1. The realtime schedule states that the bus is moving in the direction away from SFU.
  2. The first stop is its SFU starting stop.
  3. It has not departed yet (based on realtime data and static departure time data).

The important bit is number 2, since we're dependent on TransLink's realtime data to mark them correctly. I'm not exactly sure when they decide a bus has begun going the opposite direction, but the only other option would be to get bus position data and make a box around the upper loop, which would reduce the number of updates we can fetch by 50%.

@jbriones1 jbriones1 closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bus schedule modal sometimes shows confusing statuses

2 participants