Skip to content

Commit

Permalink
#1836: Ensure automatic new version creation only happens to multi-st…
Browse files Browse the repository at this point in the history
…ep jourmeys without a draft version
  • Loading branch information
JoernBerkefeld committed Dec 13, 2024
1 parent 2e3ebe7 commit c272ead
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion @types/lib/metadataTypes/Journey.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion lib/metadataTypes/Journey.js
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,11 @@ class Journey extends MetadataType {
);
const cachedVersion = cache.getByKey(this.definition.type, normalizedKey);
if (cachedVersion) {
if (cachedVersion.status === 'Draft') {
if (
cachedVersion.status === 'Draft' ||
metadataMap[metadataKey].definitionType !== 'Multistep'
) {
// we can update journeys either if there is a draft version or if the type is not multistep. transactional and quicksend journeys do not have versions.
// add version to ensure we update the correct one
metadataMap[metadataKey].version = cachedVersion.version;
// update modifiedDate field to bypass API-error "Another user recently modified this journey. Refresh to edit the latest version."
Expand Down

0 comments on commit c272ead

Please sign in to comment.