[FEATURE] transactionalPush: check options.customKeys against the app before deploy
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
Research direction
Start with TransactionalPush.preDeployTasks and MobilePushApp.definition.js; trace how the app is resolved from the cache and where options.customKeys is validated before deployment. Check the existing transactional push tests and add cases for an unknown key, a non-string value, an uncached applicationId, and the unchanged happy path. Done when the app key mismatch and invalid value are handled as specified, while an uncached app and valid definitions still deploy.
Written by the indexing model from the issue text.
Description
Background
A transactionalPush definition can carry custom keys in options.customKeys, a list of { "key": "...", "value": "..." }. Marketing Cloud checks that list against the MobilePush app the definition names (applicationId) and refuses the request when it does not fit. The messages it returns do not tell the user what to fix:
| Case | Answer of POST / PATCH /messaging/v1/push/definitions |
|---|---|
| a key that the app does not define | 404 FuelRuntime_ObjectNotFound: CustomKey(s) Not Found: <key> for application <applicationId> |
| a value that is a number instead of text | 400 MCMS_UTM_Runtime: Unknown runtime exception |
The first reads like a missing item although it is a mismatch between the definition and its app, and it shows the app's ID instead of its name. The second says nothing at all.
The first case is easy to run into when a definition is deployed to another business unit: the app is resolved by name there (r__mobilePushApp_name), and the app of the same name may define other custom keys.
mcdev already has what it needs
mobilePushAppis retrieved fromGET /push/v1/application, which lists the custom keys of each app askeys(an array of names; the property is missing for an app without custom keys).keysis part ofMobilePushApp.definition.js.TransactionalPush.preDeployTasksalready looks the app up in the cache to resolver__mobilePushApp_key/r__mobilePushApp_name.
Proposal
In TransactionalPush.preDeployTasks, after the app is resolved and before anything is sent:
-
Keys the app does not define. Compare every
options.customKeys[].keywith thekeysof the resolved app. If one is missing, stop the deployment of that item with a message that names the definition, the key(s), the app by name and ID, and the keys the app does define, for example:transactionalPush 'order_shipped': custom key 'Card_Theme' is not defined for mobilePushApp 'Customer App' (…id…) on this BU. Keys defined there: 'Order_Id', 'Deep_Link'. Add the key to the app in MobilePush Administration or remove it from options.customKeys.
If the definition carries a plain
applicationIdthat is not in the cache, the check cannot run; say so in a debug line and deploy as today. -
Values that are not text. Check that every
options.customKeys[].valueis a string. For a number or boolean either stop with a message that names the key and the value, or convert it to text and say so in a warning. Which of the two is for the maintainer to decide; converting is what the API seems to expect, since"5"is accepted where5is not.
Tests: a definition with an unknown key, one with a number as value, one with a plain applicationId that is not cached, and the unchanged happy path.
Tested
Seen on 2026-11-20 with an own test definition on a business unit with MobilePush, app with one custom key:
- create with one key of the app and one unknown key: 404 as above, nothing created
- create and change with a key of the app and a text value: 201 / 200,
options.customKeysreturned as sent - change with a number as value: 400 as above
- change that sends only
options.customKeys:options.soundis kept - change with an empty list: the property is removed from the definition
Not tested: whether a journey's push activity or a mobilePush message refuses custom keys in the same way.
- Dominant language
- JavaScript
- Stars
- 166
- Forks
- 50
- Avg merge
- 11h 4m
- Merged PRs (30d)
- 36
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Accenture/sfmc-devtools
-
e/DevOps enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Accenture/sfmc-devtools#2795 ·
Maintainers usually reply within 1 day
-
c/INIT chore
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Accenture/sfmc-devtools#2793 ·
Maintainers usually reply within 1 day
-
bug c/Generic validationRule
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Accenture/sfmc-devtools#2794 ·
Maintainers usually reply within 1 day
-
bug c/automation
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Accenture/sfmc-devtools#2792 ·
Maintainers usually reply within 1 day
-
c/mobileMessage c/mobilePush c/transactionalPush c/transactionalSms enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Accenture/sfmc-devtools#2733 ·
Maintainers usually reply within 1 day
All issues in Accenture/sfmc-devtools
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Life-Framework/Life-Framework#7017 ·
Maintainers usually reply within 1 day
-
agent/guide documentation help wanted stage/010-actionable
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
kubestellar/console-kb#4003 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
FilOzone/synapse-sdk#1201 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue task
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
NSC-Tech-Hub/nscth-static-website#107 ·
Maintainers usually reply within 1 day