Content Workspace: Load Data-Types based on Loaded Content Types#22886
Merged
madsrasmussen merged 3 commits intoMay 19, 2026
Merged
Conversation
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to address a race condition behind the “saveAndPublish spinner loop” by changing how data-type details are loaded/observed: it defers bulk data-type loading until all composed content-types are loaded, and tries to ensure only the latest data-type request drives observation.
Changes:
- Adjust content-type “loaded” detection to avoid triggering downstream work until content types/compositions are fully present.
- Rework data-type-unique derivation and add a guard intended to ignore stale in-flight bulk requests when updating observed data-type details.
- Export
withLatestFromvia the backoffice RxJS re-export barrel.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/content/content-type/structure/content-type-structure-manager.class.ts | Reworks when/how data-type uniques are emitted and adds bulk-load + stale-request guarding for data-type detail observation. |
| src/Umbraco.Web.UI.Client/src/external/rxjs/index.ts | Re-exports withLatestFrom from RxJS for internal consumption. |
Comments suppressed due to low confidence (1)
src/Umbraco.Web.UI.Client/src/packages/content/content-type/structure/content-type-structure-manager.class.ts:233
- The bulk load path ignores
{ data, error }fromrequestByUniquesand only updates#dataTypeDetailsviaasObservable(). If the detail store context isn’t available (or the bulk response is partial / errored),asObservable()can beundefinedor emit an empty array, leavingcontentTypeDataTypeDetailOf(...).asPromise()waiting forever. Handleerror, and populate#dataTypeDetailsfrom the returneddata(and/or create placeholders for missing uniques) so callers can fail fast instead of hanging.
if (dataTypeUniques && dataTypeUniques.length > 0) {
const { asObservable } = await this.#dataTypeDetailRepository.requestByUniques(dataTypeUniques);
// TODO: We should avoid this check, but architectural we are missing a way to cancel previous requests. [NL]
// It is not very likely that this happens, but we keep this check to avoid eventual race conditions. [NL]
const currentDataTypeUniques = this.getContentTypeDataTypeUniques();
if (
dataTypeUniques.length !== currentDataTypeUniques.length ||
!dataTypeUniques.every((unique) => currentDataTypeUniques.includes(unique))
) {
return;
}
if (asObservable) {
this.observe(
asObservable(),
(dataTypeDetails) => {
this.#dataTypeDetails.setValue(dataTypeDetails ?? []);
},
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
madsrasmussen
approved these changes
May 19, 2026
AndyButland
pushed a commit
that referenced
this pull request
May 19, 2026
) * Load Data-Types based on Loaded Content Types * Update Comment Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * mergeObservables approach --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This was referenced May 20, 2026
Merged
This was referenced May 25, 2026
Merged
Open
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.
Ensures only the latest Data-Type request is used for Data-Type observation.
As well optimizes the load process, to first load Data-Types when all Content-Types(Compositions) are loaded.
Fixes #22877