Skip to content

feat: don't send updates for which newer info was sent#32

Merged
optionsome merged 4 commits intoHSLdevcom:masterfrom
stadtnavi:no-outdated-msg
Dec 8, 2025
Merged

feat: don't send updates for which newer info was sent#32
optionsome merged 4 commits intoHSLdevcom:masterfrom
stadtnavi:no-outdated-msg

Conversation

@hbruch
Copy link
Contributor

@hbruch hbruch commented Nov 8, 2025

This PR stores the message-timestamp of the latest sent message per tripId and skips messages older than this timestamp.

Background of this addition: our local transit agency apparently uses multiple load balancing servers to serve gtfsrt feeds, which sadly are not in sync. This results in vehicles jumping back and forth on the map, as for subsequent calls older positions are sent after the vehicle already has moved forward.

Please let me know, if you are willing to accept this workaround for a misbehaving gtfsrt producer as upstream contribution. Otherwise, we'll consider running a custom fork.

@optionsome
Copy link
Member

I wonder if it would be enough to maintain the latest feed timestamp and compare a new message against it instead of doing it on a per trip level? I guess then some messages that you should get have slightly older timestamp than the "newest" message? I'm just slightly worried how much this increases the memory consumption.

@hbruch
Copy link
Contributor Author

hbruch commented Nov 21, 2025

You are right. I reverted the former approach and just skip feed processing, if the feed is older than the one seen before.

@hbruch
Copy link
Contributor Author

hbruch commented Dec 4, 2025

@optionsome WDYT?

Copy link
Member

@optionsome optionsome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can at least try how this works.

@optionsome optionsome merged commit 93f91d7 into HSLdevcom:master Dec 8, 2025
1 check passed
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.

2 participants