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

Guards are guarding previous route #532

Closed
Vinzent03 opened this issue Jun 19, 2022 · 1 comment
Closed

Guards are guarding previous route #532

Vinzent03 opened this issue Jun 19, 2022 · 1 comment
Labels
bug Something isn't working P0 Priority 0; do immediately

Comments

@Vinzent03
Copy link

Describe the bug
When beaming via context.beamToNamed("") the guard runs on the previous url. So it doesn't catch a wrong beam.

Beamer version: v1.5.0

To Reproduce
Steps to reproduce the behavior:

  1. Set Guard to run on /account
  2. context.beamToNamed("/account")
  3. context.beamToNamend("/account/password")

Expected behavior
Guard catches the first beam and runs its check.

Actual behavior
Guard catches the second beam and runs its check, because it now checks the uli from the first beam /account.

Smartphone

  • Device: Xiaomi Mi 9 Lite
  • OS: Android 11

Additional context
When downgrading to 1.4.0 the bug is gone without any other code changes.
I could track it down to https://github.com/slovnicki/beamer/blob/master/package/lib/src/beamer_delegate.dart#L406, where locationBuilder produced location's state has the wrong 'RouteInformation`.

@slovnicki slovnicki added the bug Something isn't working label Jul 6, 2022
@slovnicki
Copy link
Owner

Hey @Vinzent03 👋
Sorry for a late response, I've been super busy.
Now I've thoroughly looked at this and maybe figured it out.

Very curious; I started writing some test for all the cases and it seems to happen only when redirect route is the origin route (from where it is being beamed to the guarded route). I'm still not 100% sure but will try to fix this by the end of this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Priority 0; do immediately
Projects
None yet
Development

No branches or pull requests

2 participants