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

Fix Version Constraint error when saving workflows #3752

Merged
merged 2 commits into from
Mar 2, 2023

Conversation

ifranlaloe
Copy link
Contributor

The constraint error was caused by making changes to "drafts" that were based on an older version. The draftVersion being returned by GetDraftAsync() in that case was that olderVersion.Version++ this would result in the new version already existing. And when saving the new Draft a constraint error was given by the database.

The solution I went for is as following:

  1. For a Draft always work with the latest version
  2. In case of a Publish a specific version will be fetched (or created if it's a non existing one)
  3. In PublishAsync() the IsLatest property is never mutated. Only IsPublished
  4. Change the order of saving, first save the new WorkflowDefinition, in case of any error the older WorkflowDefinitions do not get their booleans modified.

@dnfadmin
Copy link

dnfadmin commented Mar 2, 2023

CLA assistant check
All CLA requirements met.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants