[FEATURE] transactionalPush: check options.customKeys against the app before deploy

Open
#2,735 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@orshih6 is already working on this.

Since Nov 26, 2026.

  • #2743 by @orshih6 — open

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
Domain
devops, tooling

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

c/mobilePushApp c/transactionalPush enhancement
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
  • mobilePushApp is retrieved from GET /push/v1/application, which lists the custom keys of each app as keys (an array of names; the property is missing for an app without custom keys). keys is part of MobilePushApp.definition.js.
  • TransactionalPush.preDeployTasks already looks the app up in the cache to resolve r__mobilePushApp_key / r__mobilePushApp_name.
Proposal

In TransactionalPush.preDeployTasks, after the app is resolved and before anything is sent:

  1. Keys the app does not define. Compare every options.customKeys[].key with the keys of 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 applicationId that is not in the cache, the check cannot run; say so in a debug line and deploy as today.

  2. Values that are not text. Check that every options.customKeys[].value is 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 where 5 is 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.customKeys returned as sent
  • change with a number as value: 400 as above
  • change that sends only options.customKeys: options.sound is 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Accenture/sfmc-devtools

All issues in Accenture/sfmc-devtools

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.