diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js --- a/keyserver/src/push/send.js +++ b/keyserver/src/push/send.js @@ -512,6 +512,13 @@ }; if (copyWithMessageInfos.length() <= apnMaxNotificationPayloadByteSize) { notification.payload.messageInfos = messageInfos; + return notification; + } + const notificationCopy = _cloneDeep(notification); + if (notificationCopy.length() > apnMaxNotificationPayloadByteSize) { + console.warn( + `iOS notification ${uniqueID} exceeds size limit, even with messageInfos omitted`, + ); } return notification; } @@ -565,6 +572,15 @@ ) { return copyWithMessageInfos; } + + if ( + Buffer.byteLength(JSON.stringify(notification)) > + fcmMaxNotificationPayloadByteSize + ) { + console.warn( + `Android notification ${notifID} exceeds size limit, even with messageInfos omitted`, + ); + } return notification; }