delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

SubscribeListener does not has the callback response? #135

Closed Lemniscate317 closed 7 years ago

Lemniscate317 commented 7 years ago

maybe the title is confuse,so i list my connect code and subscribe code; when the wifi is connected.i use meteor.connect() to connect server. and use the while to check isConnect

while(!connected){
   connected = meteor.isConnected
   //sleep code;
}

when connected,i subscribe a method.in the server code,i have console.log on it,and i can see it print in teminal.so the method(or subscribe methed?) is called.

Meteor.publish('xxxxx', (args) => {
        console.log('xxxxx enter');
        return collection.find({ args})
    })

now the issue is,in my server code.in the lower tag code.it can get the subscribelistener response,and in the higher tag code,it can't get the subscribelistener response.both of that,the server code can print the console.log,so the method are all called.so i am confuse,i am also add the login in code,because i guess is i add the account-passcode package, but it cant work too.But the account-passcode package is add before the lower tag code and higher tag code,so it may not the key of the issue,so i cant understand why i cant get the subscibe response in the higher tag code.

i hope you can understand what i say,thank you

Lemniscate317 commented 7 years ago

and i checked the git log,between the lower tag code and the higher tag code,there are't any package change

Lemniscate317 commented 7 years ago

i find why. the lower code

return collections.find()

the higher code

return collection.findOne()
ocram commented 7 years ago

Thanks for sharing your solution!