-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Clear timetables after withdrawn NEW trips #6280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-2.x
Are you sure you want to change the base?
Clear timetables after withdrawn NEW trips #6280
Conversation
5a4a351 to
d931077
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6280 +/- ##
==========================================
Coverage 72.05% 72.06%
- Complexity 20644 20649 +5
==========================================
Files 2231 2231
Lines 83543 83568 +25
Branches 8346 8348 +2
==========================================
+ Hits 60198 60220 +22
- Misses 20420 20422 +2
- Partials 2925 2926 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
application/src/main/java/org/opentripplanner/model/TimetableSnapshot.java
Outdated
Show resolved
Hide resolved
|
Sorry it seems that the bug still appears on the live server, so I need to mark this as draft for now. |
|
The solution will not work if a timetable is cleared multiple times between commits. Also on my live server log there are a lot of "WARN could not fetch timetable for pattern" which may be related to this problem as well. I'll need to further fix it. |
|
What does this line actually mean: Line 198 in d931077
My server log is flooded with this. |
…Layer during commit
|
Would it work and would it be simpler if:
|
I think it will be better and I will work on this. |
|
Unfortunately TransitLayerUpdater is not feed aware and it doesn't really have a state, so it is not possible for me to do that without adding complexity into the system. There is no concept of a "feed" and the "original" in the TransitLayer. |
only do the actual restoration when committing if it isn't subsequently made dirty
|
I have updated my approach as the original contained a mistake which broke the cancelled trip fetching. I have now deferred the actual restoration of the timetable to the time of commit. When |
# Conflicts: # application/src/main/java/org/opentripplanner/model/TimetableSnapshot.java
Release 2.7.0
74914c5 to
6352234
Compare
6352234 to
d315867
Compare
|
I would like to discuss this again given that #6909 didn't fix the bug. |
|
@miklcct I think the correct thing would be to refactor the The proposed fix looks like it will work and it is probably the best solution without refactoring the |
|
@miklcct I took a look at this last week and I agree with @habrahamsson-skanetrafiken that it's the cleanest we can currently do. However, I think the tests could be a little cleaner, for that reason I opened #7129 which contains tests for the SIRI code and crucially a disabled test for this case. Once it is merged, I will review this one. This PR also resolves two disabled test cases about new patterns being generated, which were recently added by @flaktack. |
PR Instructions
Summary
Currently, after clearing TimetableSnapshot, if it is committed directly empty, nothing is passed to TransitLayerUpdater. As a result, previously added trip patterns remain in the TransitLayer for routing purpose, resulting in stale timetables returned in itinerary results which no longer exist in the actual, published timetable snapshot.
Issue
Fixes #6197
Unit tests
Added
Documentation
Bug fix only, not needed
Changelog