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

Wrong route gets served #246

Open
maiertech opened this issue Jun 5, 2024 · 9 comments · Fixed by #322
Open

Wrong route gets served #246

maiertech opened this issue Jun 5, 2024 · 9 comments · Fixed by #322
Assignees
Labels
Blocked An issue that is blocked by another issue or another blocker. Bug Something isn't working Frontend This issue pertains to the UniMe frontend.

Comments

@maiertech
Copy link
Member

Description

When running UniMe in dev on macOS, occasionally, it looks like SvelteKit serves the wrong route. This can happen in different routes.

Hardware Specification

Happens in development on macOS.

Steps to Reproduce the Bug

This bug was observed by @daniel-mader and @maiertech. Both have not managed to find a reproduction.

Expected Behaviour

In the animated GIF I am on route /welcome/password and click on the continue button. I expect to be taken to route /welcome/password/confirm.

Actual Behaviour

When I am on route /welcome/password I click on the continue button and unexpectedly see route /welcome/pledge:

unime-ezgif com-crop

Errors

No errors in the logs.

@maiertech maiertech added the Bug Something isn't working label Jun 5, 2024
@maiertech
Copy link
Member Author

When I log SvelteKit's navigating store and then click on the continue button on route /welcome/password, I see the following object:

{
  complete: Promise {status: "fulfilled", result: undefined},
  from: {params: {}, route: {id: "/welcome/password"}, url: URL},
  to: {params: {}, route: {id: "/welcome/password/confirm"}, url: URL},
  type: "goto",
  willUnload: false
}

This is the correct object, i.e. SvelteKit does not navigate to /welcome/pledge. When I output $page.url.pathname in the root layout, I see /welcome/password/confirm when SvelteKit is done navigating, but with the content of /welcome/pledge.

This makes me believe that this is some esoteric Safari caching problem.

The workaround is to disable caches in the Network tab in Safari's DevTools:

disable-cache

@maiertech
Copy link
Member Author

For now, wait and see if we can reproduce this in the future.

@maiertech maiertech changed the title Wrong route gets served [Bug] Wrong route gets served Jun 5, 2024
@maiertech maiertech added the Blocked An issue that is blocked by another issue or another blocker. label Jun 5, 2024
@maiertech maiertech changed the title [Bug] Wrong route gets served Wrong route gets served Jun 6, 2024
@maiertech
Copy link
Member Author

maiertech commented Jun 7, 2024

This is another instance of a wrong route getting served in dev. The app routes from the password confirmation screen back to the password confirmation screen. This is not because the passwords don't match. After the second password confirmation attempt, the Continue button freezes.

tauri-bug

Console

There are no logs in the console that give a hint on what is going wrong.

$navigating store

When on route /welcome/password/confirm for the first time and when clicking Continue (after validation passes), the navigating store looks like this:

{
  complete: Promise {status: "pending"},
  from: {params: {}, route: {id: "/welcome/password/confirm"}, url: URL},
  to: {params: {}, route: {id: "/welcome/password/completed"}, url: URL},
  type: "goto",
  willUnload: false
}

Again, SvelteKit navigates to the correct route, but the wrong UI is visible. The second time, navigating looks like this

{
  complete: Promise {status: "fulfilled", result: undefined},
  from: {params: {}, route: {id: "/welcome/password/completed"}, url: URL},
  to: {params: {}, route: {id: "/welcome/password/completed"}, url: URL},
  type: "goto",
  willUnload: false
}

This is correct given what UI is shown, but makes no sense.

As a workaround, disable the cache as described in a comment further up.

@maiertech maiertech added the Frontend This issue pertains to the UniMe frontend. label Jul 3, 2024
@Oran-Dan
Copy link
Contributor

I encounter the exact same problem as described in the main description on Ubuntu 22.04.

@maiertech maiertech self-assigned this Aug 5, 2024
@maiertech
Copy link
Member Author

The root cause is still unclear and still not reproducible.

It might be related to how Tauri listen is configured, or a backend-triggered redirect interfering with an unrelated ongoing SvelteKit navigation.

I will try wiring up Tauri listen in the root layout onMount and let it handle backend-triggered redirects.

@maiertech maiertech linked a pull request Aug 6, 2024 that will close this issue
6 tasks
@maiertech
Copy link
Member Author

Wire up Tauri listeners in onMount of root layout: #322.

May not fix this, but it's cleaner and easier to understand.

@Oran-Dan
Copy link
Contributor

Oran-Dan commented Aug 8, 2024

New instance of a wrong route, this is on branch `chore/bump-did-manager.
clicking Me - Profile icon top left - My profile - Profile name.

Screencast.from.08-08-24.16.06.04.webm

@maiertech
Copy link
Member Author

Accidentally closed. Reopening.

@maiertech maiertech reopened this Aug 28, 2024
@github-project-automation github-project-automation bot moved this from Done to Backlog in Impierce SSI Stack Aug 28, 2024
@M-Adam-Hus
Copy link

Wrong route gets served

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked An issue that is blocked by another issue or another blocker. Bug Something isn't working Frontend This issue pertains to the UniMe frontend.
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

3 participants