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 @@ -513,6 +513,11 @@ if (copyWithMessageInfos.length() <= apnMaxNotificationPayloadByteSize) { notification.payload.messageInfos = messageInfos; } + if (notification.length() > apnMaxNotificationPayloadByteSize) { + console.warn( + 'iOS notification exceeds size limit, even with messageInfos omitted', + ); + } return notification; } @@ -564,8 +569,17 @@ fcmMaxNotificationPayloadByteSize ) { return copyWithMessageInfos; + } else { + if ( + Buffer.byteLength(JSON.stringify(notification)) > + fcmMaxNotificationPayloadByteSize + ) { + console.warn( + 'Android notification exceeds size limit, even with messageInfos omitted', + ); + } + return notification; } - return notification; } type NotificationInfo =