diff --git a/keyserver/src/push/crypto.js b/keyserver/src/push/crypto.js --- a/keyserver/src/push/crypto.js +++ b/keyserver/src/push/crypto.js @@ -198,12 +198,19 @@ +encryptionOrder?: number, }> { const { id, badgeOnly, ...unencryptedPayload } = notification.data; + let plainTextData = { badgeOnly }; + if (id) { + plainTextData = { ...plainTextData, id }; + } + let payloadSizeValidator; if (notificationSizeValidator) { payloadSizeValidator = ( payload: AndroidNotificationPayload | { +encryptedPayload: string }, ) => { - return notificationSizeValidator({ data: { id, badgeOnly, ...payload } }); + return notificationSizeValidator({ + data: { ...plainTextData, ...payload }, + }); }; } const { resultPayload, payloadSizeExceeded, encryptionOrder } = @@ -215,8 +222,7 @@ return { notification: { data: { - id, - badgeOnly, + ...plainTextData, ...resultPayload, }, },