-
Notifications
You must be signed in to change notification settings - Fork 388
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: Invalid CanActivate guard in cmsMapping #19265
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merge Checks Failed
|
…into bugfix/CXSPA-7552
Merge Checks Failed
|
Merge Checks Failed
|
Merge Checks Failed
|
spartacus Run #45036
Run Properties:
|
Project |
spartacus
|
Branch Review |
bugfix/CXSPA-7552
|
Run status |
Passed #45036
|
Run duration | 03m 36s |
Commit |
438506d376 ℹ️: Merge 65dbcf10619cdc94f44c53a249add111e57bca4d into 267231983dddbeef941f6a31edbb...
|
Committer | kpawelczak |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
3
|
Pending |
2
|
Skipped |
0
|
Passing |
125
|
View all changes introduced in this branch ↗︎ |
Platonn
previously approved these changes
Sep 27, 2024
Platonn
approved these changes
Sep 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes: CXSPA-7552
This change was made to break the reference to the canActivate array in the routing configuration. The previous implementation directly modified the route.canActivate array, leading to unintended side effects when the function was re-executed, particularly with lazy-loaded modules.
Reason for the Change:
This change was implemented to avoid mutating the original
route
object, which could lead to issues in the following scenario:Lazy-loaded module: The function is triggered each time a lazy-loaded module is loaded.
Logout and Re-login: After logging out and then logging in again, the routing function is triggered again.
Side effect: On the second execution (e.g., when navigating to "my-account/my-company"), the canActivate guards were already overwritten due to reference mutation in the previous run.
By breaking the reference and returning a new
route
object with a copiedcanActivate
array, we make sure that each execution works with a fresh set of guards without mutating the original route object.note:
route
object