-
Notifications
You must be signed in to change notification settings - Fork 44
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
editoast, front: forbid zero-length paths in pathfinding endpoint #9931
Conversation
7c7ecdd
to
9b5ea0c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #9931 +/- ##
=======================================
Coverage 81.80% 81.80%
=======================================
Files 1073 1073
Lines 106584 106601 +17
Branches 731 731
=======================================
+ Hits 87192 87207 +15
- Misses 19353 19355 +2
Partials 39 39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
5564da9
to
4cb44f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from this, looks good!
Note This will conflict with #9924 |
Should we authorize pathfinding that has a total length higher than |
858887c
to
94aee2d
Compare
838a3ea
to
df926d1
Compare
01850f1
to
30a4ecb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes, one more thing :)
30a4ecb
to
5c13dfe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm and tested, great job !
2e294ea
to
97db6c4
Compare
- Editoast: treat core pathfinding responses with a length of zero as errors. - Frontend, stdcm: add error notifications when the user enters the same origin and destination. Signed-off-by: Loup Federico <[email protected]>
Pathfinding is prevented when some validity checks don't pass, as for example when the user selects the same origin and destination. The error warning was only updated when pathfinging occurs, causing the user warnings not to be displayed when we could detect before launching the pathfinding that its request would be invalid. Update the warnings independently on whether the pathfinding actually happened so that invalid checks preventing the pathfinding also generate their user warnings. Signed-off-by: Loup Federico <[email protected]>
97db6c4
to
2a2142a
Compare
Fixes #9444
Editoast: immediately return a422 Unprocessable Content
error at deserialization when the endpointpathfinding/blocks
is called with the same origin and destination.pathfinding/blocks
: fail in post-processing with a newPathfindingInputError::ZeroLengthPath
variant when core returns zero-length paths.