Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report : Registration failed - push service error #3195

Closed
naveedahmed1 opened this issue Jun 9, 2020 · 24 comments
Closed

Bug Report : Registration failed - push service error #3195

naveedahmed1 opened this issue Jun 9, 2020 · 24 comments

Comments

@naveedahmed1
Copy link

[REQUIRED] Describe your environment

  • Operating System version: Windows 10
  • Browser version: Chrome Version 83.0.4103.61 (Official Build) (64-bit)
  • Firebase SDK version: 7.15.0
  • Firebase Product: Firebase Messaging

[REQUIRED] Describe the problem

I'm using Angular Fire and when requesting token using below code it throws error

Code

this.messaging.requestToken
      .subscribe((token) => {
        this.sendTokenToServer(token);
      },
        (error) => {
          console.error(error);
          this._gs.hideOverlay();
        },
      );

Error
Uncaught DOMException: Registration failed - push service error

This issue occurs randomly, I mean the same code which works perfectly suddenly breaks and start throwing this errror.

If I create a new profile on Chrome (i.e. a new user), the exact same code starts working on same machine.

I think its an old issue but has not be permanently fixed, and I believe this should be thoroughly investigated and fixed.

Below are the issues I found on Firebase and Angular Fire Repos,

#909

FirebaseExtended/polymerfire#345

#771

#152

angular/angularfire#2475

Steps to reproduce:

I have no idea whats actually causing the issue and issue occurs randomly, hence don't know how to reproduce the issue.

For https://www.mustakbil.com/ its working for some users and not for others. In my case its working fine on Android and broken on desktop, if I setup new profile it works jut fine.

The issue is, its broken even for some of the new and first time users of the website.

Relevant Code:

Angular Fire code.

this.messaging.requestToken
      .subscribe((token) => {
        this.sendTokenToServer(token);
      },
        (error) => {
          console.error(error);
          this._gs.hideOverlay();
        },
      );

I would have reported this issue on Angular Fire repo, but in my opinion the issue is related to Firebase library. Since I have seen posts complaining about same issue while using different frameworks.

Thank you or your attention to this issue.

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@mmikrut
Copy link

mmikrut commented Jun 17, 2020

Same issue yesterday on a stable PWA deployed many months ago.
However it seems to be browser related. Clearing Service workers and storage in Chrome Dev Tools / Application have fixed the problem.

@naveedahmed1
Copy link
Author

Clearing Service workers and storage in Chrome Dev Tools / Application have fixed the problem.

In my case even this doesn't work unless I creat new user profile (reported by other users as well)

I also initially thought this that it must be related to the browser but then I came across the other demos of firebase push notifications, hosted on different domains and all of them had the same issue on the same chrome user profile. But when I tested it with other websites that were for example using other push notification service providers for example one signal it was working fine on same user profile of chrome.

@mmikrut
Copy link

mmikrut commented Jun 20, 2020

I still think its browser related, as we just tested, same user on two PCs ( iMac & Linux), both running newest version of chrome. PWA works on iMac, chrome on linux displays push service error

@naveedahmed1
Copy link
Author

In my case it only happens with sites using firebase js sdk.

@shadow1349
Copy link

I left a comment on the other issue, but this is a super annoying issue so I'm going to link that comment here as well: angular/angularfire#2475 (comment)

@hdoro
Copy link

hdoro commented Oct 20, 2020

I'm also facing this issue, but that happens only Brave (even when I deactivate the privacy shield); Edge, Firefox and Opera are working fine.

I'm using a npm version of firebase (7.23.0) inside of a React app that has another service worker running, if that helps contextualizing the problem :)

@shadow1349
Copy link

Yeah all the other browsers were working ok for me, but Brave is my main browser

@eugenioclrc
Copy link

same error here!, also using brave in linux

@naveedahmed1
Copy link
Author

Any update on this?

I just checked chrome://gcm-internals/ and under Registration Log it shows TOO_MANY_REGISTRATIONS. Any idea what could have caused this? And how to fix this?

@naveedahmed1
Copy link
Author

If I take a look at Registration Log it seems any call to messaging.getToken and messaging.requestToken methods tries to get registration token with a new random App Id. as a result we have too many registrations.

Example 'App Id's

wp:https://www.mustakbil.com/#BB0DB796-278C-474F-A734-32B35E3E2-V2
wp:https://www.mustakbil.com/#D00AD433-4922-4E22-846D-05DF35109-V2
wp:https://www.mustakbil.com/#D00AD183-4922-4E22-885D-05DF35109-V2
wp:https://www.mustakbil.com/#3FF9E22C-231B-4C61-9C1E-F38B31290-V2
wp:https://www.mustakbil.com/#D7158487-E513-4C08-A904-373567A69-V2

@naveedahmed1
Copy link
Author

I have also opened a issue with Chrome team, https://bugs.chromium.org/p/chromium/issues/detail?id=1153182

@marcusmmmz
Copy link

Any updates on this? Still happens in Brave in Manjaro Linux

@natemartins
Copy link

natemartins commented Apr 21, 2021

I'm also experiencing same issue on Brave and Chrome. Same code which has been working for more than 6 months just started throwing that error this week

@aalluri7
Copy link

aalluri7 commented May 5, 2021

any updates on this we are getting the same error intermittently

@wbobeirne
Copy link

This is intentional behavior in Brave, they disable using Google's push service by default for privacy reasons. As far as I have seen, they do not have on their roadmap a replacement for it and will continue to leave it disabled by default. You can enable it by going to brave://settings/privacy and enabling "Use Google services for push messaging." Here are some related issues:

  1. Notification problem for some web sites brave/brave-browser#15062
  2. Desktop push notifications do not always function (twitter, reddit, etc) brave/brave-browser#2362

@atzzCokeK
Copy link

@wbobeirne
Thanks, it helps a lot.

@DellaBitta
Copy link
Contributor

DellaBitta commented Jun 7, 2023

It's been a while. Checking in to see if this is a Brave configuration issue for folks that's helped by wboberine's post above. Thanks!

@soulcm
Copy link

soulcm commented Jun 9, 2023

I have the same issue on Android Chrome,Does anybody resolved?

@DellaBitta
Copy link
Contributor

@soulcm, is your environment the same as the original ticket? If not, I'd ask you to create a new issue with details about the configuration you're using and the code that's failing. Thanks!

@naveedahmed1
Copy link
Author

In my experience the issue occurs on frequent calls to requestToken / deleteToken. In our case, we were calling requestToken on user login and deleteToken on user logout from our website, or when user clicks the toggle notifications button i.e. call requestToken when user clicks Enable Notifications button and call deleteToken when user click Disable Notifications button.

As a workaround, we now never call deleteToken, instead we track the unsubscription on our own server.

@zwu52
Copy link
Member

zwu52 commented Jun 27, 2023

In my experience the issue occurs on frequent calls to requestToken / deleteToken. In our case, we were calling requestToken on user login and deleteToken on user logout from our website, or when user clicks the toggle notifications button i.e. call requestToken when user clicks Enable Notifications button and call deleteToken when user click Disable Notifications button.

As a workaround, we now never call deleteToken, instead we track the unsubscription on our own server.

following up on this thread, couple qs:

  • @naveedahmed1 know this is an old thread, but what SDK versions are you on? are you still seeing this error?
  • out of curiosity: we track the unsubscription on our own server how is this flow currently implemented in breid

@google-oss-bot
Copy link
Contributor

Hey @naveedahmed1. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@naveedahmed1 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@firebase firebase locked and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests