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

fix(router-store): ignore trailing slash when comparing routes #2834

Merged
merged 1 commit into from
Dec 22, 2020

Conversation

alex-okrushko
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

Ignore trailing slash (/) when comparing URLs in the navigateIfNeed method of the router-store.

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

proceeds with re-navigation, which can lead to infinite loop if there's a guard on / or `` path (root).

Closes #2829

What is the new behavior?

Doesn't navigate if the changes in Store lead to the URL being the same as the current one (previously only the exact match would've prevented it).

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@damienwebdev
Copy link

Commit message has a typo, but otherwise the code LGTM.

@alex-okrushko alex-okrushko changed the title fix(router-store): ingore slash when comparing routes fix(router-store): ignore slash when comparing routes Dec 20, 2020
@brandonroberts
Copy link
Member

Also related to #1781

@brandonroberts brandonroberts changed the title fix(router-store): ignore slash when comparing routes fix(router-store): ignore trailing slash when comparing routes Dec 21, 2020
@brandonroberts brandonroberts merged commit cad3f60 into master Dec 22, 2020
@brandonroberts brandonroberts deleted the router-comparison branch December 22, 2020 14:12
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.

bug(router-store): emitting guard results from state changes can cause infinite loops in certain circumstances
3 participants