Introduce delay and expand path matching on Backoffice router for lazy-loaded routes#19409
Merged
iOvergaard merged 3 commits intorelease/16.0from May 26, 2025
Merged
Introduce delay and expand path matching on Backoffice router for lazy-loaded routes#19409iOvergaard merged 3 commits intorelease/16.0from
iOvergaard merged 3 commits intorelease/16.0from
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances route redirects by enforcing full path matching on default routes and introduces a delay mechanism for initial redirects to ensure all routes register before navigation.
- Add
pathMatch: 'full'to empty-path redirects to prevent unintended root fallback. - Implement
awaitStabilitywith a network-based delay inRouterSlotfor initial redirect timing. - Extend the redirect model (
IRedirectRoute) to include the optionalawaitStabilityflag.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| created-packages-section-view.element.ts | Added pathMatch: 'full' to default redirect. |
| member-workspace-editor.element.ts | Added pathMatch: 'full' to default redirect. |
| media-workspace-editor.element.ts | Added pathMatch: 'full' to default redirect. |
| media-dashboard.element.ts | Added pathMatch: 'full' to default redirect. |
| document-blueprint-workspace-editor.element.ts | Added pathMatch: 'full' to default redirect. |
| content-editor.element.ts | Added pathMatch: 'full' to default redirect. |
| content-type-design-editor.element.ts | Added pathMatch: 'full' to default redirect. |
| block-workspace-view-edit.element.ts | Added pathMatch: 'full' to default redirect. |
| backoffice-main.element.ts | Added pathMatch: 'full' and awaitStability: true to initial redirect. |
| router-slot.ts | Added getRedirectDelay() and delay logic around awaitStability. |
| model.ts | Extended IRedirectRoute with awaitStability?. |
| example-modal.element.ts | Added pathMatch: 'full' to default redirect in modal example. |
| dashboard.element.ts | Added pathMatch: 'full' to default redirect in dashboard example. |
Comments suppressed due to low confidence (1)
src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot/router-slot.ts:408
- Add unit tests for the
awaitStabilitylogic to verify that redirects are correctly delayed and canceled when navigation is invalidated.
if (route.awaitStability === true) {
src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot/router-slot.ts
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot/router-slot.ts
Show resolved
Hide resolved
iOvergaard
approved these changes
May 26, 2025
This file contains hidden or 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
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.
The cases described here fixes an issue that only appeared on an actual server. these can be seen on a local server by running with

disabled cacheand a network throttling like this:This fixes two things:
A.
Fixes so a deep link does not just redirect to the root of a section, typically
section/settings— this is resolved by using pathMatch 'full', a feature of the router slot we have not utilized previously.B.
Fixes so the initial empty path load does not go to section/settings, just because it loaded slightly before the content section. This is done by introducing a feature that makes redirects await a delay, the delay will be reset everytime a new route appears, making it able to extend the time as long as routes are getting registered within the given delay. And then the delay is calculated based on the browsers assumption on the internet speed. That's a guess but better than none.