Skip to content

V16 RC: Documents show "Not found" when switching between variant and invariant views, and other edge cases #19425

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

Merged

Conversation

iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented May 27, 2025

Niels added:
Clears the structure manager before it starts loading its new type. — which fixes the routing problem.

@iOvergaard iOvergaard changed the base branch from main to release/16.0 May 27, 2025 08:26
@iOvergaard iOvergaard marked this pull request as ready for review May 28, 2025 11:32
@Copilot Copilot AI review requested due to automatic review settings May 28, 2025 11:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 UmbDocumentWorkspaceSplitViewElement to a dynamic import for code-splitting.
  • Updated optional chaining for this._manager?.variantId and wrapped observe().asPromise() in serverUpgradeCheck with 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?.variantId may silently hide cases where _manager is unexpectedly undefined; consider validating or logging when _manager is missing.
this._manager?.variantId,

src/apps/backoffice/backoffice.context.ts:81

  • [nitpick] Swallowing errors in serverUpgradeCheck may make debugging version lookup issues harder—consider at least logging the error before returning null.
.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 undefined without causing unhandled exceptions.
.catch(() => {

@iOvergaard iOvergaard changed the title fix: add a catcher to most asPromise for stores to prevent cascading errors V16 RC: Documents show "Not found" when switching between variant and invariant views, and other edge cases May 28, 2025
@iOvergaard iOvergaard merged commit 595e4ed into release/16.0 May 28, 2025
22 of 23 checks passed
@iOvergaard iOvergaard deleted the v16/bugfix/document-not-found-context-disconnected branch May 28, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants