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

Logging in after starting a route removes you from that route #3339

Closed
jonfroehlich opened this issue Aug 3, 2023 · 5 comments · Fixed by #3485
Closed

Logging in after starting a route removes you from that route #3339

jonfroehlich opened this issue Aug 3, 2023 · 5 comments · Fixed by #3485
Assignees

Comments

@jonfroehlich
Copy link
Member

jonfroehlich commented Aug 3, 2023

This happened to me today (and yesterday).

  1. I click on a custom route link for our user study
  2. It takes me to Project Sidewalk
  3. I start auditing and realize that I'm not actually on the custom route. And, instead, I'm just doing a regular Project Sidewalk mission

Unfortunately, I've burned 20+ mins (15 yesterday, 8 today) not realizing immediately that I'm on the custom route and, instead, auditing in the regular mission.

As an easy fix, let's just do this #3272 so I at least get verification that I'm on the correct route. This will help with the user study too.

Longer term, we'll have to figure out why this happens: is it because I logged in, or because of the tutorial, etc., and then try to fix it.

PredictionModel-IThoughtIWasDoingRoute2ButLooksLikeIWasntProblem.mp4
@misaugstad
Copy link
Member

This happened to me today (and yesterday).
Longer term, we'll have to figure out why this happens: is it because I logged in, or because of the tutorial, etc.

The problem is that you logged in, just tested it. When making RouteBuilder I tested that you can do the tutorial and it still brings you to the route, but I didn't check for signing in! I just tried it now, and I get taken from the route if I sign in as you did.

The first time this happened yesterday was probably for another reason entirely, it had to do with how I had just added streets to the database but had missed a step.

@jonfroehlich
Copy link
Member Author

Gotcha. Thanks Mikey.

@misaugstad misaugstad added the Bug label Aug 4, 2023
@misaugstad misaugstad changed the title Click on Custom Route Link but Given Different Mission Logging in after starting a route removes you from that route Aug 4, 2023
@misaugstad
Copy link
Member

I've edited the title to reflect that the bug has to do with signing in!

@misaugstad
Copy link
Member

You can reproduce this by opening signing out on your local dev env, going to localhost:9000/routeBuilder, building a short route there, clicking save then "Explore route", then signing in through the navbar once the Explore page loads.

I believe the issue is that signing in through the navbar ends up calling

routes.CredentialsAuthController.authenticate(url.getOrElse("/"))

where the url var does not include the query parameters that would be necessary to bring the user to that route.

The parameters that we probably want are ?routeId=<route_id>&resumeRoute=true. The problem is that I don't really see us having access to the route ID (or even knowing that we are on a user-defined route). I tried to be clever by rewriting the URL so that we only show "/explore" instead of a bunch of query params (keeping them can lead to other issues when refreshing the page), but now we don't have access to those query params in this situation.

There are some gross solutions like passing the route ID as an optional param to navbar.scala.html that is only used by the Explore page. Even more gross would be for navbar.scala.html to check if we are on the Explore page, and if so, parse the text in the current-mission-header element to check for a route ID...

I think that gross solution number 1 is probably our best look?

@misaugstad
Copy link
Member

Oh wait! I'm now seeing that we are actually hardcoding in the /explore URL when adding the navbar (line 13 of explore.scala.html).

@navbar(user, Some("/explore"))

We do have access to the route ID here, so we should be able to include that in the URL if we are on a user-defined route!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants