MatthieuLemoine / electron-push-receiver

A module to bring Web Push support to Electron allowing it to receive notifications from Firebase Cloud Messaging (FCM).
https://medium.com/@MatthieuLemoine/my-journey-to-bring-web-push-support-to-node-and-electron-ce70eea1c0b0
MIT License
194 stars 69 forks source link

"Connection lasted less than 1 minute" purpose? #5

Closed PedroKantar closed 7 years ago

PedroKantar commented 7 years ago

Hi Matthieu,

I'm facing the "Connection lasted less than 1 minute" case:

Connection to MCS server lost MCS socket closed after 0 minutes Connection lasted less than 1 minute Giving up...

Basically, if the internet connection is lost before one minute, after the connect took place, the "retry" mechanism is disabled forever and no more push notifications..

What is the purpose of this mechanism? Why could not we keep on retrying even if the connection was lost very quickly after the connect operation?

Thanks, Pedro.

MatthieuLemoine commented 7 years ago

Ah yeah I didn't think about that ! Nice catch !

The purpose was just to avoid infinite retry if MCS server kick the client out because of a registration issue or something like this.

PedroKantar commented 7 years ago

OK, I see..

MatthieuLemoine commented 7 years ago

Fix in v1.2.1

PedroKantar commented 7 years ago

Thanks for tagging as a bug, I thought I could over come this case at API level, but I did not receive any error via the NOTIFICATION_SERVICE_ERROR channel.