Skip to content

Conversation

vpaturet
Copy link
Contributor

@vpaturet vpaturet commented Oct 10, 2025

Summary

As detailed in #6948, there is a regression in the way invalid locations are handled in the plan query.
This PR fixes the regression.

  • Since Cleanup RouteRequest - make it immutable #6653 it is not possible anymore to build an invalid RouteRequest since validation is performed in RouteRequestBuilder (invalid requests throw RoutingValidationException).
    As a consequences some code branches end up with a null request that triggers an NPE.

  • This PR fixes the issue by building an empty TripPlan (without itineraries) in the case of an invalid route request.

Additional refactoring: introducing a builder for PlanResponse

Issue

Closes #6948

Unit tests

Added unit tests.

Documentation

No

Changelog

skip

@vpaturet vpaturet self-assigned this Oct 10, 2025
@vpaturet vpaturet added !Bug Apply to issues describing a bug and PRs witch fixes it. +Skip Changelog This is not a relevant change for a product owner since last release. labels Oct 10, 2025
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 63.75000% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.20%. Comparing base (3281ab7) to head (66c7078).
⚠️ Report is 3 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...nner/apis/transmodel/TransmodelGraphQLPlanner.java 0.00% 18 Missing ⚠️
...ipplanner/apis/transmodel/model/plan/TripType.java 53.84% 6 Missing ⚠️
...ripplanner/apis/transmodel/model/PlanResponse.java 93.93% 0 Missing and 2 partials ⚠️
...anner/routing/api/request/RouteRequestBuilder.java 0.00% 2 Missing ⚠️
...nner/routing/algorithm/mapping/TripPlanMapper.java 87.50% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6961      +/-   ##
=============================================
+ Coverage      72.18%   72.20%   +0.01%     
- Complexity     19839    19856      +17     
=============================================
  Files           2155     2155              
  Lines          80051    80092      +41     
  Branches        8082     8083       +1     
=============================================
+ Hits           57785    57827      +42     
  Misses         19419    19419              
+ Partials        2847     2846       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vpaturet vpaturet marked this pull request as ready for review October 10, 2025 07:00
@vpaturet vpaturet requested a review from a team as a code owner October 10, 2025 07:00
@vpaturet vpaturet marked this pull request as draft October 10, 2025 07:08
@vpaturet vpaturet force-pushed the fix_npe_in_trip_plan_query branch 3 times, most recently from 8815c32 to 0de51c3 Compare October 10, 2025 16:29
@vpaturet vpaturet force-pushed the fix_npe_in_trip_plan_query branch 4 times, most recently from b944032 to e3ee8e7 Compare October 21, 2025 13:35
@vpaturet vpaturet force-pushed the fix_npe_in_trip_plan_query branch from e3ee8e7 to 4ef5f1a Compare October 21, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it. +Skip Changelog This is not a relevant change for a product owner since last release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled exception in TransModel API when querying to/from an invalid location

1 participant