Global Elements: Workspace hotfix for 'Unique is missing' warning#22935
Conversation
|
Claude finished @leekelleher's task in 1m 59s —— View job PR ReviewTarget: Fixes a race condition in Suggestions
ApprovedThe fallback is safe: |
There was a problem hiding this comment.
Pull request overview
Fixes a race condition in the Elements publishing workspace context that could throw Error: Unique is missing when navigating between Element workspaces (notably in the Library section) during 18.0-beta. The fix ensures the pending-changes/published-data logic can resolve an entity unique even in the short window where getUnique() intentionally returns undefined before _getDataPromise is set.
Changes:
- Update
#loadAndProcessLastPublished()to fall back to the locally tracked#currentUniquewhengetUnique()returnsundefined. - Add inline comments clarifying why
getUnique()may returnundefinedand why#currentUniqueis a safe fallback in this context.
AndyButland
left a comment
There was a problem hiding this comment.
I've tested this locally and confirmed I could see the error before the fix and no longer after.
Will merge in as the failing unit tests are not related.
Description
In the 18.0-beta, when navigating between Element workspaces in the Library section, the following error fired:
This was due to a race condition between the
uniqueobservable and thegetUnique()guard in the entity-detail workspace base.This PR resolves this by falling back to
#currentUnique, as this is kept up-to-date from theuniqueobservable.