V16 RC: Documents show "Not found" when switching between variant and invariant views, and other edge cases#19425
Merged
iOvergaard merged 20 commits intorelease/16.0from May 28, 2025
Conversation
src/Umbraco.Web.UI.Client/src/packages/core/repository/detail/detail-repository-base.ts
Outdated
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/src/packages/core/repository/item/item-repository-base.ts
Outdated
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/src/packages/core/tree/data/tree-repository-base.ts
Outdated
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/src/packages/core/tree/data/tree-repository-base.ts
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances resilience by adding error handlers to most .asPromise() calls when consuming contexts, preventing cascading failures by unsetting unavailable stores or contexts. It also optimizes loading the split-view component via dynamic import and updates some optional chaining and error handling for version checks.
- Added
.catch()to.asPromise({ preventTimeout: true })calls across multiple repositories/contexts. - Switched static instantiation of
UmbDocumentWorkspaceSplitViewElementto a dynamic import for code-splitting. - Updated optional chaining for
this._manager?.variantIdand wrappedobserve().asPromise()inserverUpgradeCheckwith error handling.
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/packages/webhook/webhook-event/repository/webhook-event.repository.ts | Added .catch() to clear #store on error |
| src/packages/user/user/repository/user-repository-base.ts | Wrapped each .asPromise() with .catch() to unset stores/contexts |
| src/packages/user/user-group/collection/repository/user-group-collection.repository.ts | Added .catch() to clear #detailStore on error |
| src/packages/user/current-user/repository/current-user.repository.ts | Wrapped .asPromise() calls with .catch() to clear stores/contexts |
| src/packages/user/current-user/current-user.context.ts | Added .catch() to unset #currentUser on failure |
| src/packages/members/member/repository/member-repository-base.ts | Added error handlers to all .asPromise() calls for stores/contexts |
| src/packages/documents/documents/workspace/document-workspace-editor.element.ts | Replaced static split-view element with dynamic import |
| src/packages/documents/documents/publishing/workspace-context/document-publishing.workspace-context.ts | Wrapped .asPromise() calls with .catch() to clear contexts |
| src/packages/data-type/repository/detail/data-type-detail.repository.ts | Added .catch() to clear #detailStore on failure |
| src/packages/data-type/collection/repository/data-type-collection.repository.ts | Added .catch() to clear #itemStore |
| src/packages/core/tree/data/tree-repository-base.ts | Added error handler to .asPromise() clearing _treeStore |
| src/packages/core/repository/item/item-repository-base.ts | Wrapped .asPromise() with .catch() to clear _itemStore |
| src/packages/core/repository/detail/detail-repository-base.ts | Added .catch() to clear #detailStore on error |
| src/packages/content/property-type/workspace/property-type-workspace.context.ts | Added .catch() to clear #contentTypeContext |
| src/packages/block/block/context/block-entry.context.ts | Changed this._manager.variantId to this._manager?.variantId for safety |
| src/apps/backoffice/backoffice.context.ts | Updated serverUpgradeCheck to catch version lookup errors |
Comments suppressed due to low confidence (4)
src/packages/core/tree/data/tree-repository-base.ts:67
- There are many repeated
.asPromise(...).catch(...)patterns across repositories—consider extracting a helper method to wrap this logic for consistency and reduced duplication.
}).asPromise({ preventTimeout: true })
src/packages/block/block/context/block-entry.context.ts:559
- Using optional chaining on
this._manager?.variantIdmay silently hide cases where_manageris unexpectedly undefined; consider validating or logging when_manageris missing.
this._manager?.variantId,
src/apps/backoffice/backoffice.context.ts:81
- [nitpick] Swallowing errors in
serverUpgradeCheckmay make debugging version lookup issues harder—consider at least logging the error before returningnull.
.catch(() => null)
src/packages/user/user/repository/user-repository-base.ts:24
- Add tests to verify that when consuming a context fails (e.g., store unavailable), the repository correctly falls back to
undefinedwithout causing unhandled exceptions.
.catch(() => {
…cument-not-found-context-disconnected
src/Umbraco.Web.UI.Client/src/packages/core/repository/item/item-repository-base.ts
Outdated
Show resolved
Hide resolved
asPromise for stores to prevent cascading errors
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.
Niels added:
Clears the structure manager before it starts loading its new type. — which fixes the routing problem.