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

Aperta
#2,735 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@orshih6 ci sta già lavorando.

Dal 26/11/2026.

  • #2743 di @orshih6 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
74/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
devops, tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
166
Fork
50
Merge medio
11h 4m
PR unite (30g)
36

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Accenture/sfmc-devtools

Tutte le issue di Accenture/sfmc-devtools

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.