title: Firebase FCM (Javascript): Error when request permission (Error status = 500)
body: <p>I'm new to Firebase Cloud Messaging and I need to implement notifications in my webapp.
  If the browser requests notification for the first time there is no error occurred and the token fetched successfuly. But if I delete the notification from the browser parametre (I use Chrome) and ask for permission again, it shows me an error in the console.</p>
  
  <pre><code>DELETE https://fcmregistrations.googleapis.com/v1/projects/teak-perigee-*****/registrations/dcVW8MdcapIy5CrSqGutkj:APA91bFoslZEsjgIk16CUfol*****************
  
  FirebaseError: Messaging: A problem occured while unsubscribing the user from FCM: FirebaseError: Messaging: A problem occured while unsubscribing the user from FCM: Internal error encountered. (messaging/token-unsubscribe-failed). (messaging/token-unsubscribe-failed).
  </code></pre>
  
  <p>Actually the token is fetched even this error occurs. but in this situation I handle the new token in the <code>catch</code> block of the promise. This is my code when permission is fired:</p>
  
  <pre><code>askForPermissioToReceiveNotifications = () =&gt; {
  
      const messaging = firebase.messaging();
  
     Notification.requestPermission().then(async (permission) =&gt; {
  
      if(permission == 'granted') {
  
          try {
  
              const token = await messaging.getToken();
  
              if(token) {
  
                  console.log(token);
                  return token;
              }
  
              else {
                  console.log('No Instance ID token available. Request permission to generate one.');
              }
          }
  
          catch(error) {
  
              console.log('An error occurred while retrieving token. ', error);
  
  
              //BUT THE NEW TOKEN SUCCESSFULY FETCHED
              const token = await messaging.getToken();
  
              if(token) {
  
                  console.log(token);
                  return token;
              }
  
              else {
                  console.log('No Instance ID token available. Request permission to generate one.');
              }
          }
      }
  
  })
  .catch(error =&gt; console.log(error));
  </code></pre>
  
  <p>}</p>
  
  <p>I don't know if I miss something and I hope I can find a solution.</p>