Repository navigation
Bugs related to DST and service date - #5004
Conversation
It turns out that the error was in the trip-pattern-for-day extract, selecting the wrong range of days.
| this.departureDate = transitSearchTimeZero.toLocalDate(); | ||
| this.departureDate = ServiceDateUtils.asServiceDay(transitSearchTimeZero); |
There was a problem hiding this comment.
This is a bit complex, since we already know the date for the trip search one frame up in the call chain. Would it make sense to pass it separately, rather than compute it again from a computed value?
There was a problem hiding this comment.
Or rather we could pass in the date here, and compute the transitSearchTimeZero from the date and transitLayer timezone
There was a problem hiding this comment.
This is a bugfix and I do not want to take any risk. So, I do not want to include a refactoring. I plan to clean-up this as part of the #4002.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5004 +/- ##
=============================================
+ Coverage 64.07% 64.16% +0.09%
- Complexity 13588 13724 +136
=============================================
Files 1675 1687 +12
Lines 66261 66738 +477
Branches 7149 7187 +38
=============================================
+ Hits 42456 42823 +367
- Misses 21429 21516 +87
- Partials 2376 2399 +23
... and 113 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
In some legacy cases the operatingDay is passed into OTP with time and zoneID. To get the correct operating day we simply ignore time and zone-id. The existing code was wrong for days with DST forward adjustments.
d60c9b9 to
45b2ee7
Compare
|
@t2gran Not completely obvious from reading the PR description, but as I understand:
Correct? |
|
@vpaturet, your summary of ServiceDay/OperatingDay is correct.
To be clear, the LocalDate is defined by the LocalDate at noon, not when the service day starts(midnight). In most cases this is the same day, but not "when transitioning from standard time to DST it is 23:00 local time". |
Summary
This PR fixes 2 errors related to DST adjustments.
Fix empty arriveBy search
When selecting trip-pattern-for-day otp used ended up using the previous day for arrive-by search. This again cased OTP to search an empty set of patterns.
fix SIRI alerts operatingDay resolving
In some legacy cases the operatingDay is passed into OTP with time and zoneID. To get
the correct operating day we simply ignore time and zone-id. The existing code was
wrong for days with DST forward adjustments. This only apply to the SIRI updaters.
Issue
No issue for this.
Unit tests
Unit test for the
ServiceDateUtilsis updated, but no module/integration test is added. The plan is to delete this code, and we can not reuse the tests.Documentation
No.