diff --git a/etc/firebase-admin.messaging.api.md b/etc/firebase-admin.messaging.api.md index 1814ee4b87..43ffc272e3 100644 --- a/etc/firebase-admin.messaging.api.md +++ b/etc/firebase-admin.messaging.api.md @@ -211,6 +211,7 @@ export const MessagingErrorCode: { readonly INVALID_PACKAGE_NAME: "invalid-package-name"; readonly DEVICE_MESSAGE_RATE_EXCEEDED: "device-message-rate-exceeded"; readonly TOPICS_MESSAGE_RATE_EXCEEDED: "topics-message-rate-exceeded"; + readonly TOPICS_SUBSCRIPTION_RATE_EXCEEDED: "topics-subscription-rate-exceeded"; readonly MESSAGE_RATE_EXCEEDED: "message-rate-exceeded"; readonly THIRD_PARTY_AUTH_ERROR: "third-party-auth-error"; readonly TOO_MANY_TOPICS: "too-many-topics"; diff --git a/src/messaging/error.ts b/src/messaging/error.ts index e51b9c272a..9e91e04e28 100644 --- a/src/messaging/error.ts +++ b/src/messaging/error.ts @@ -34,6 +34,7 @@ export const MessagingErrorCode = { INVALID_PACKAGE_NAME: 'invalid-package-name', DEVICE_MESSAGE_RATE_EXCEEDED: 'device-message-rate-exceeded', TOPICS_MESSAGE_RATE_EXCEEDED: 'topics-message-rate-exceeded', + TOPICS_SUBSCRIPTION_RATE_EXCEEDED: 'topics-subscription-rate-exceeded', MESSAGE_RATE_EXCEEDED: 'message-rate-exceeded', THIRD_PARTY_AUTH_ERROR: 'third-party-auth-error', TOO_MANY_TOPICS: 'too-many-topics', @@ -112,6 +113,12 @@ export const messagingClientErrorCode: { readonly [K in keyof typeof MessagingEr 'high. Reduce the number of messages sent for this topic, and do not immediately retry sending ' + 'to this topic.', }, + TOPICS_SUBSCRIPTION_RATE_EXCEEDED: { + code: MessagingErrorCode.TOPICS_SUBSCRIPTION_RATE_EXCEEDED, + message: 'The rate of subscription management requests to a particular topic is too ' + + 'high. Reduce the number of requests sent for this topic, and do not immediately retry the ' + + 'request.', + }, MESSAGE_RATE_EXCEEDED: { code: MessagingErrorCode.MESSAGE_RATE_EXCEEDED, message: 'Sending limit exceeded for the message target.', @@ -207,7 +214,7 @@ const TOPIC_MGT_SERVER_TO_CLIENT_CODE: Record