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

Reduction of count from the collection #120

Open musriabhijit opened 7 years ago

musriabhijit commented 7 years ago

@ocram when we subscribe to the endpoint with unique id, after subscription the unique id document data is removed from the particular collection

eg :mMeteor.subscribe("user.id", userID); the above userID document is removed from the particular collection Database

ocram commented 7 years ago

If you call

mMeteor.subscribe("user.id", userID);

then it will subscribe to data from the server, unless you didn't publish something called user.id on the server. Use the listener with the optional parameter (see README) to check if the subscription succeeds or not. If it does, you will get additional data from the server.

Please insert log statements in onDataAdded, onDataChanged and onDataRemoved to see what's actually happening there. This way, you can precisely track down what's being added and removed and why that's happening.

musriabhijit commented 7 years ago

my question is the document from the collection get removed when i subscribe to a particular element in other activity and in when i come back to same activity the particular document in the collection gets removed

ocram commented 7 years ago

Can you provide any specific (step-by-step) description of how to re-produce this? Perhaps even with a minimum code example. Otherwise, we can't re-produce this right now and have never heard about that problem, so we'd close this until there is more evidence.