Skip to content
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

Hotfix: Ensure scaffolding is done before initializing the redirect controller #2514

Merged

Conversation

madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented Nov 6, 2024

Description

This PR addresses an issue encountered when changing from editing an existing entity to creating a new one of the same type. In some workspaces, when users attempted to create a new entity, the isNew state, which should be set to true upon creation, was mistakenly retained as false from the editing state at first. This resulted in a redirect from the create URL back to the edit URL.

To fix this, this PR ensures that the redirect controller is initialized after the scaffolding logic is complete. Since the scaffolding/create method is already async, it makes sense to await this so we first start observing the "isNew" state afterward. This way, we ensure that the state we observe is correct.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

@madsrasmussen madsrasmussen marked this pull request as ready for review November 6, 2024 12:13
@nielslyngsoe nielslyngsoe self-assigned this Nov 6, 2024
@nielslyngsoe nielslyngsoe merged commit 0e03439 into release/15.0 Nov 6, 2024
8 of 9 checks passed
@nielslyngsoe nielslyngsoe deleted the 15/hotfix/redirect-when-creating-new-gone-wrong branch November 6, 2024 12:40
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