diff --git a/lib/push/android-notif-creators.js b/lib/push/android-notif-creators.js --- a/lib/push/android-notif-creators.js +++ b/lib/push/android-notif-creators.js @@ -7,10 +7,7 @@ prepareEncryptedAndroidVisualNotifications, prepareEncryptedAndroidSilentNotifications, } from './crypto.js'; -import { - hasMinCodeVersion, - FUTURE_CODE_VERSION, -} from '../shared/version-utils.js'; +import { hasMinCodeVersion } from '../shared/version-utils.js'; import type { PlatformDetails } from '../types/device-types.js'; import { messageTypes } from '../types/message-types-enum.js'; import { @@ -288,12 +285,6 @@ }, }; - invariant( - (rescindID && badge) || - hasMinCodeVersion(platformDetails, { native: FUTURE_CODE_VERSION }), - 'thick thread rescind not support for this client version', - ); - if (rescindID && badge) { notification = { ...notification, @@ -349,12 +340,6 @@ const { senderDeviceDescriptor, platformDetails, badge, threadID } = inputData; - invariant( - (!threadID && badge) || - hasMinCodeVersion(platformDetails, { native: FUTURE_CODE_VERSION }), - 'thick thread badge updates not support for this client version', - ); - let notificationData = { badgeOnly: '1' }; if (badge) { notificationData = { diff --git a/lib/push/apns-notif-creators.js b/lib/push/apns-notif-creators.js --- a/lib/push/apns-notif-creators.js +++ b/lib/push/apns-notif-creators.js @@ -12,10 +12,7 @@ prepareEncryptedAPNsSilentNotifications, } from './crypto.js'; import { getAPNsNotificationTopic } from '../shared/notif-utils.js'; -import { - hasMinCodeVersion, - FUTURE_CODE_VERSION, -} from '../shared/version-utils.js'; +import { hasMinCodeVersion } from '../shared/version-utils.js'; import type { PlatformDetails } from '../types/device-types.js'; import { messageTypes } from '../types/message-types-enum.js'; import { @@ -331,12 +328,6 @@ senderDeviceDescriptor, } = inputData; - invariant( - (rescindID && badge !== null && badge !== undefined) || - hasMinCodeVersion(platformDetails, { native: FUTURE_CODE_VERSION }), - 'thick thread rescind not support for this client version', - ); - const apnsTopic = getAPNsNotificationTopic(platformDetails); let notification; @@ -433,11 +424,6 @@ ): Promise<$ReadOnlyArray> { const { senderDeviceDescriptor, platformDetails, threadID, badge } = inputData; - invariant( - (!threadID && badge !== undefined && badge !== null) || - hasMinCodeVersion(platformDetails, { native: FUTURE_CODE_VERSION }), - 'thick thread badge updates not support for this client version', - ); const shouldBeEncrypted = hasMinCodeVersion(platformDetails, { native: 222, diff --git a/lib/push/send-utils.js b/lib/push/send-utils.js --- a/lib/push/send-utils.js +++ b/lib/push/send-utils.js @@ -38,6 +38,10 @@ isMemberActive, threadInfoFromRawThreadInfo, } from '../shared/thread-utils.js'; +import { + FUTURE_CODE_VERSION, + hasMinCodeVersion, +} from '../shared/version-utils.js'; import type { AuxUserInfos } from '../types/aux-user-types.js'; import type { PlatformDetails, Platform } from '../types/device-types.js'; import { @@ -514,6 +518,16 @@ majorDesktopVersion, }; + if ( + !hasMinCodeVersion(platformDetails, { + native: FUTURE_CODE_VERSION, + web: FUTURE_CODE_VERSION, + majorDesktop: FUTURE_CODE_VERSION, + }) + ) { + continue; + } + const inputData = transformInputBase( notifCreatorInputBase, platformDetails,