Fix bug in optimize transfer service decorating path#3587
Merged
t2gran merged 4 commits intoAug 19, 2021
Conversation
When Raptor return a path with a transfer at another stop than the optimal stop to transfer, then optimized transfer service will find the correct stop/path, but the transfer information is not attached to the new path in a correct way. The OptimizedPath map of transfers(transfersTo) are updated with the correct transfer, but the key used is the old leg, not the new. This causes the lookup to fail later.
Add unit tests to verify the fix is correct and to prevent it from happening again.
82f44b7 to
1a7545b
Compare
abyrd
reviewed
Aug 19, 2021
Comment on lines
+26
to
+27
| * Trip 1 10:02 10:10 10:15 10:20 10:25 10:30 | ||
| * Trip 2 10:13 10:18 10:24 10:30 10:36 10:40 |
Member
There was a problem hiding this comment.
Discussed diffrent formatting: 10:10 (A) 10:13 (B) eliminating Stop row.
abyrd
reviewed
Aug 19, 2021
|
|
||
| /** | ||
| * <pre> | ||
| * DEPARTURE TIMES |
Member
There was a problem hiding this comment.
Each column represents one possible transfer.
abyrd
approved these changes
Aug 19, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When Raptor return a path with a transfer at another stop then the optimal stop to transfer, then optimized transfer service will find the correct stop/path, but the transfer information is not attached to the new path in a correct way. The OptimizedPath map of transfers(transfersTo) are updated with the correct transfer, but the key used is the old leg, not the new. This causes the lookup to fail later.
Issue
No issue is created for this "small" bugfix.
Unit tests
The second commit add extensive unit-tests for this case. It also improve the tests on TransferPriority, witch was not properly tested. The tests are "semi" high level. They test the OptimizePathService, low level tests already exist.
Documentation
Only JavaDoc is updated.
Changelog
Changelog.mdis updated.