guness / node-xcs

NodeJS implementation of Google's XMPP Connection Server
BSD 2-Clause "Simplified" License
38 stars 23 forks source link

Sender._send fails due to API change in node-xmpp-client v3.0.1 #6

Closed javamonn closed 8 years ago

javamonn commented 8 years ago

Hi,

I get an error thrown as soon as I receive an upstream message:

/Users/daniel/project-dir/node_modules/node-xcs/google/Sender.js:128
        var message = new xmpp.Stanza.Element('message').c('gcm', {xmlns: 'google:mobile:data'}).t(JSON.stringify(json));
                      ^

TypeError: xmpp.Stanza.Element is not a function
    at Sender._send (/Users/daniel/project-dir/node_modules/node-xcs/google/Sender.js:128:23)

Looked into this a bit and node-xmpp-client released version 3.0.1 about a week ago and gets installed by node-xcs due to the ^3.0.0 glob. When I pin the node-xmpp-client dep specifically at 3.0.0 I don't get this error.

guness commented 8 years ago

I am not available to deep look into this one right now. Is it better to pin or merge this one https://github.com/chaitanya0bhagvan/node-xcs/commit/c4f55b22e4e0a284b3a3203b2b6bafa44ed3e877 ?

guness commented 8 years ago

this commit fixes the issue: https://github.com/guness/node-xcs/commit/9f9e1c478594787d49505bec1e79fab608cd8bf0