MatthieuLemoine / push-receiver

A library to subscribe to GCM/FCM and receive notifications within a node process.
https://medium.com/@MatthieuLemoine/my-journey-to-bring-web-push-support-to-node-and-electron-ce70eea1c0b0
MIT License
203 stars 81 forks source link

Crypto-key not found #21

Closed benoist closed 6 years ago

benoist commented 6 years ago

Hi,

I have a user that gets an error with the message that the value doesn't exist:

image

It looks like there is not item with key 'crypto-key' But I don't know how to resolve that issue. Any ideas?

  const cryptoKey = object.appData
    .find(item => item.key === 'crypto-key')
    .value.slice(3);
MatthieuLemoine commented 6 years ago

Hi @benoist,

Yeah sorry about that ! It was already raised here.

It seems that sometimes messages received from FCM are incomplete. We could drop them & just log a warning instead of throwing an error.

Could you make a PR to fix this issue ?

benoist commented 6 years ago

Hi Matthieu,

Sure, I'll try to do something later today. Thanks for the quick response.

MatthieuLemoine commented 6 years ago

Fix released in v2.0.2