[FCM] "getToken" returns invalid token after resetting browser permissions
Operating System
MacOS Sonoma 14.3
Browser Version
Chrome/Version 121.0.6167.139
Firebase SDK Version
10.7.2
Firebase SDK Product:
Messaging
Describe your project's tooling
Next.js 13.4.12
Describe the problem
After granting browser notification permissions, the call to "getToken" returns an invalid token. Push messages are not being received by the Messaging instance using this token. It seems that an additional call to "getToken" will detect the invalid token and return a new one (which is valid at this point).
Ideally, after granting permissions, the call to "getToken" should not return an invalid token.
Steps and code to reproduce issue
- Initialize Firebase, call "getToken" on page load
- Grant permission to notify (if necessary, reset browser permissions)
- Check retrieved token value in IndexedDB
- Reload page, see that "getToken" call has returned a new token
FYI, I suspect there may be a race condition involved with this issue since the issue occurs intermittently.
Any update on this issue ?
No longer noticing this issue on v10.8.0