Skip to content
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

Only query single route if segmentRange specified #544

Closed
wants to merge 3 commits into from

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Jul 12, 2024

Removes two queries on loading a route on master and the other attempt at this

Copy link

github-actions bot commented Jul 12, 2024

Welcome to connect! Make sure to:

  • read the contributing guidelines
  • mark your PR as a draft until it's ready to review
  • post the preview on Discord; feedback from users will speedup the PR review

deployed preview: https://544.connect-d5y.pages.dev

@@ -148,7 +166,12 @@ export function urlForState(dongleId, log_id, start, end, prime) {
}

function updateTimeline(state, dispatch, log_id, start, end, allowPathChange) {
dispatch(checkRoutesData());
Copy link
Contributor Author

@sshane sshane Jul 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in #419, I'm not sure why. It re-queries the API twice on loading any route (from URL only). With this change, this ends up breaking something in ACTION_ROUTES_METADATA as it is also called twice; the second time segmentRange's start and end values are properly set, but that function only works if they're both NaN on first load (??). On master, querying the API the first time here is fine because the limit param just happens to be set to 0 so currentRoute isn't set yet, which would change segmentRange's start and end lol

In summary: I'm amazed connect works as well as it does

@commaai commaai deleted a comment from sentry-io bot Jul 12, 2024
@sshane sshane changed the title Only route name if segmentRange specified Only query route name if segmentRange specified Jul 12, 2024
@sshane sshane changed the title Only query route name if segmentRange specified Only query single route if segmentRange specified Jul 12, 2024
@sshane
Copy link
Contributor Author

sshane commented Jul 12, 2024

Implemented these changes in: #522

@sshane sshane closed this Jul 12, 2024
@sshane sshane deleted the load-any-route branch July 12, 2024 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant