'Firebase id token generation is broken

Context

I am making an Angular web application using firebase messaging. I followed a tutoriel and the documentation to configure firebase successfully (I guess).
Everything was okay to generate a firebase id token on client and then use it to subscribe to some topics and then receive push message.

Issue

But since 2 days, my token seems to be invalid on Chrome browser. It is still generated correctly and printed in the console when I use getToken() function (from 'firebase/messaging').
But when I try to use it to subscribe to a topic on the server side (NestJS app) with subscribeToTopic(topicName) from 'firebase-admin' I get the following error everytime

code: 'messaging/registration-token-not-registered',
message: 'The provided registration token is not registered. A previously valid registration token can be unregistered for a variety of reasons. See the error documentation for more details. Remove this registration token and stop using it to send messages.'

I understand what the error says, but I am so far unabled to delete the token and make firebase generate another one. I tryed the following function to delete the token without success

getToken(getMessaging(), { vapidKey: environment.firebase.vapidKey }).then(
   (token) => deleteToken(getMessaging())
);

FirebaseError: Messaging: A problem occurred while unsubscribing the user from FCM: FirebaseError: Messaging: A problem occurred while unsubscribing the user from FCM: Requested entity was not found. (messaging/token-unsubscribe-failed). (messaging/token-unsubscribe-failed)

My configuration and code seems correct because if I run my app on Firefox browser, everything works fine and the token is correct
How can I fix this ? Is there a way to force firebase to refresh the client token and generate another valid one ?



Solution 1:[1]

I finally fixed this going to F12 (developer tools) > Application > Storage > Clear site data. Firebase now generate a new valid token that works for calling API functions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TCH