Skip to content

Conversation

@nielslyngsoe
Copy link
Member

First set isNew when data has been set.

Fixes #20544

Copilot AI review requested due to automatic review settings November 19, 2025 15:51
@nielslyngsoe nielslyngsoe enabled auto-merge (squash) November 19, 2025 15:51
Copilot finished reviewing on behalf of nielslyngsoe November 19, 2025 15:53
Copy link
Contributor

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 fixes a timing issue in the entity detail workspace where isNew was being set before the entity data was initialized. The fix ensures that when creating a scaffold for a new entity, the data (including unique identifier, persisted state, and current state) is set before marking the entity as new.

  • Moved setIsNew(true) to be called after data initialization in the createScaffold method
  • Prevents race conditions where UI components observing isNew might access uninitialized data

@madsrasmussen
Copy link
Contributor

madsrasmussen commented Nov 21, 2025

I am a little concerned about moving this around to solve a problem. I think the correct time for isNew to be set is as early as possible. We already know this information when the workspace is set up, which is why I don’t think this information should wait for data.

Doesn't this example show a solution without this fix? #20899

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.

Unable to set node name on Content Workspace Content - without using a setTimeout

3 participants