opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.12k stars 1.01k forks source link

Fix debug client after breaking change in dependency graphql-request #5899

Closed testower closed 3 weeks ago

testower commented 3 weeks ago

Debug client is broken if VITE_API_URL is a relative path (which it is by default). This is due to a breaking change in v7.0.0 of graphql-request, which I overlooked when approving the upgrade: https://github.com/jasonkuhrt/graphql-request/releases/tag/7.0.0

This PR checks validity of VITE_API_URL by passing it to the URL constructor. If exception is thrown, we prefix it with the window's origin (which used to be the default behavior).

I still need to test this PR Tested locally.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.63%. Comparing base (ef530a6) to head (0177051). Report is 24 commits behind head on dev-2.x.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev-2.x #5899 +/- ## ============================================= + Coverage 68.61% 68.63% +0.02% - Complexity 16823 16837 +14 ============================================= Files 1927 1927 Lines 72942 72955 +13 Branches 7476 7482 +6 ============================================= + Hits 50050 50075 +25 + Misses 20318 20299 -19 - Partials 2574 2581 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

leonardehrenfried commented 3 weeks ago

As agreed with the dev team, this only needs a single reviewer.