Avoid cumulative real-time updates - #5705
Conversation
…not earlier updates.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5705 +/- ##
=============================================
+ Coverage 67.69% 67.71% +0.01%
- Complexity 16369 16410 +41
=============================================
Files 1890 1896 +6
Lines 71812 71964 +152
Branches 7407 7419 +12
=============================================
+ Hits 48611 48728 +117
- Misses 20692 20726 +34
- Partials 2509 2510 +1 ☔ View full report in Codecov by Sentry. |
|
I'm frankly suprised that the updates are cumulative and would have expected (at least in the GTFS-RT case) it not to be the case, so I think this is the correct behaviour. |
bb6f06a to
dd135d1
Compare
leonardehrenfried
left a comment
There was a problem hiding this comment.
I've tested this with several IBI data sets and all worked fine, including the stop consolidation.
However, I don't think anybody was ever relying on updates to stop patterns being cumulative.
|
Found some minor spelling while reading through the PR. |
Co-authored-by: Johan Torin <jtorin@users.noreply.github.com>
Summary
Realtime updates (at least Siri ET) should in general not be treated as cumulative updates. This make the logic complicated, you need to account for all kind of updates when applying a new on top of others. In the case of a malicious update, resending a ok one will not fix the problem as well.
This PR changes the stop-pattern logic so that a update is applied on top of the planned stop-pattern and not the last version from the previous update.
There are a few places where this happens, so I included a few commits witch revert the changes if needed. The plan is either to drop those commits or to squash them.(I have removed these commits now, since no one requested them).I would like to see som tests of this with various updators:
Issue
At Entur we applied the following update several time and OTP toggled between the expected state (Stop 1,,2,3 CANCELED) and not (Stop 1,2,3 SCHEDULED).
Netex data set - One line
Siri update
To reproduce the problem, you can start OTP with the given data set and use the following build-config.json
Possible challanges
Existing systems may relay on cumulative updates.
Unit tests
✅ One unit tests is added, and a few updated.
Documentation
Only JavaDoc
Changelog
✅
Bumping the serialization version id
🟥 Not needed