parse-server-modules / parse-server-onesignal-push-adapter

OneSignal push adapter for parse-server
MIT License
32 stars 28 forks source link

Error on send #2

Closed lolobosse closed 8 years ago

lolobosse commented 8 years ago

Hi @flovilmart,

Great lib.

I have an error, which doesn't block the push but is there:

error while sending push TypeError: Cannot read property 'device' of undefined
    at /Users/laurentmeyer/JobNinja/JobNinjaServer/node_modules/parse-server/lib/pushStatusHandler.js:86:20
    at Array.reduce (native)
    at Object.complete (/Users/laurentmeyer/JobNinja/JobNinjaServer/node_modules/parse-server/lib/pushStatusHandler.js:84:15)
    at /Users/laurentmeyer/JobNinja/JobNinjaServer/node_modules/parse-server/lib/Controllers/PushController.js:129:27
    at run (/Users/laurentmeyer/JobNinja/JobNinjaServer/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:89:22)
    at /Users/laurentmeyer/JobNinja/JobNinjaServer/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:102:28
    at flush (/Users/laurentmeyer/JobNinja/JobNinjaServer/node_modules/babel-polyfill/node_modules/core-js/modules/_microtask.js:14:5)
    at _combinedTickCallback (node.js:370:9)
    at process._tickDomainCallback (node.js:425:11)

Btw doc is not soooooo great (like the formatting of the push, I had to look into source code). I may help to improve that if I got a bit of time

flovilmart commented 8 years ago

Yeah, that's a known issue on Parse server. I've pushed a fix to silently fail, it will just report 0 numSent as One Signal don't report the status right away, but it would be nice to have the properly formatted reponse in This adapter.

lolobosse commented 8 years ago

The fix is not released, is it?

flovilmart commented 8 years ago

Not yet. Soon I believe

flovilmart commented 8 years ago

Should be fixed now