ToothlessGear / node-gcm

A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
https://github.com/ToothlessGear/node-gcm
Other
1.3k stars 208 forks source link

TypeError: results of undefined #299

Closed Balgorn closed 7 years ago

Balgorn commented 7 years ago

Hey while checking for a crash in my application I found following stacktrace):

I was using version 0.14.4 of the

    at /notification/node_modules/node-gcm/lib/sender.js:39:21    
    at Request._callback (/notification/node_modules/node-gcm/lib/sender.js:165:13)    
    at Request.self.callback (/notification/node_modules/request/request.js:187:22)    
    at emitTwo (events.js:106:13)\n    at Request.emit (events.js:191:7)    
    at Request.<anonymous> (/notification/node_modules/request/request.js:1044:10)
    at emitOne (events.js:96:13)    
    at Request.emit (events.js:188:7)    
    at IncomingMessage.<anonymous> (/notification/node_modules/request/request.js:965:12)\n    
    at emitNone (events.js:91:20)    
    at IncomingMessage.emit (events.js:185:7)

My application sends messages batched per 1000 packages only to FCM/GCM. One of the requests results into the above error.

eladnava commented 7 years ago

Hi @Balgorn, Thanks for reporting this.

This has been fixed in the most recent versions: https://github.com/ToothlessGear/node-gcm/blob/5540a1cffbb7e4fc64fca8b02b5d1d3ab4f229aa/lib/sender.js#L173-L178

Please update your project to use the latest version of node-gcm. 👍