title: Firebase Messaging fails sporadically with internal-error
body: <p>I've been getting internal error quite a lot this week while sending messages to my iOS devices through the Node.js library (code is the same, same library version etc.)</p>
  <p>It's hard to debug because sometimes it works. When I put a for loop to send 10 messages, my devices would get 3-4.</p>
  <pre><code>FirebaseMessagingError: Internal error encountered.
  &gt;      at FirebaseMessagingError.FirebaseError [as constructor] (/node_modules/firebase-admin/lib/utils/error.js:42:28)
  &gt;      at FirebaseMessagingError.PrefixedFirebaseError [as constructor] (/node_modules/firebase-admin/lib/utils/error.js:88:28)
  &gt;      at new FirebaseMessagingError (/node_modules/firebase-admin/lib/utils/error.js:254:16)
  &gt;      at Function.FirebaseMessagingError.fromServerError (/node_modules/firebase-admin/lib/utils/error.js:287:16)
  &gt;      at Object.createFirebaseError (/node_modules/firebase-admin/lib/messaging/messaging-errors.js:34:47)
  &gt;      at FirebaseMessagingRequestHandler.buildSendResponse (/node_modules/firebase-admin/lib/messaging/messaging-api-request.js:119:47)
  &gt;      at /node_modules/firebase-admin/lib/messaging/messaging-api-request.js:94:30
  &gt;      at Array.map (&lt;anonymous&gt;)
  &gt;      at /node_modules/firebase-admin/lib/messaging/messaging-api-request.js:93:30
  &gt;      at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  &gt;    errorInfo: {
  &gt;      code: 'messaging/internal-error',
  &gt;      message: 'Internal error encountered.'
  &gt;    },
  &gt;    codePrefix: 'messaging'
  &gt;  } 
  </code></pre>
  <p>I tried changing the auth key, but still getting errors.</p>
  <p>Code is very simple</p>
  <pre><code>import * as admin from 'firebase-admin'
  admin.initializeApp()
  async function sendPushNotification(
    tokens: string[],
    title: string,
    body: string
  ): Promise&lt;admin.messaging.BatchResponse&gt; {
    console.log('sending %s to %d devices', body, tokens.length)
    const message = {
      notification: {
        title: title,
        body: body,
      },
      tokens: tokens,
      apns: {
        payload: {
          aps: {
            sound: 'default',
          },
        },
      },
    }
    return admin.messaging().sendMulticast(message)
  }
  </code></pre>