Skip to content

Commit

Permalink
#1943: prevent attempt to deploy published transactional journey
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Jan 13, 2025
1 parent d5021d5 commit f9976e9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/metadataTypes/Journey.js
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,11 @@ class Journey extends MetadataType {
break;
}
case 'Transactional': {
const cachedVersion = cache.getByKey('journey', metadata.key);
if (cachedVersion.status === 'Published') {
throw new Error(`Cannot update transactional-send journey in Published status`);
}

// Transactional Send Journey
// ~~~ TRIGGERS ~~~~
// ! journeys so far transactional EMAIL messages. SMS and Push do not create their own journey.
Expand All @@ -1323,7 +1328,6 @@ class Journey extends MetadataType {
activity.configurationArguments.triggeredSendKey =
activity.configurationArguments.r__transactionalEmail_key;
} catch (ex) {
const cachedVersion = cache.getByKey('journey', metadata.key);
const isCreateMode = !cachedVersion;
if (
(isCreateMode && !Util.OPTIONS.publish) ||
Expand Down Expand Up @@ -1365,9 +1369,7 @@ class Journey extends MetadataType {
default: {
// it is expected that we'll see 'sms' and 'push' here in the future
throw new Error(
` - ${this.definition.type} ${metadata[this.definition.nameField]} (${
metadata[this.definition.keyField]
}): channel ${
`channel ${
metadata.channel
} is not supported yet. Please open a ticket at https://github.com/Accenture/sfmc-devtools/issues/new/choose to request it`
);
Expand All @@ -1378,9 +1380,7 @@ class Journey extends MetadataType {
}
default: {
throw new Error(
` - ${this.definition.type} ${metadata[this.definition.nameField]} (${
metadata[this.definition.keyField]
}): definitionType ${
`definitionType ${
metadata.definitionType
} is not supported yet. Please open a ticket at https://github.com/Accenture/sfmc-devtools/issues/new/choose to request it`
);
Expand Down

0 comments on commit f9976e9

Please sign in to comment.