You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this DDP client to run Cucumber tests. In between my tests I close the connection and reopen it, in between which ddp.collections is not cleaned. This results in the same documents getting pushed into it multiple times.
I currently solve this by doing:
ddp.close();ddp.collections={};
The text was updated successfully, but these errors were encountered:
Hi, I was looking at this for v0.12.0, but it seems that the DDP spec is silent on this issue. The Meteor.disconnect() call is the nearest analog to ddp.close() in the Meteor API, and it pretty explicitly says that while collections (obviously) stop updating, they are not cleared by even an intentional disconnect. Although this package also does not have an exact equivalent to the Meteor.reconnect() functionality, running ddp.connect() seems to have much the same effect. However, the issue seems to be that the session identifier doesn't appear to ever be (re)used, which prevents the server from knowing the existing state of the collections, to prevent re-sending data.
So I see two possible solutions. Either remain "sessionless" and always clear the collections upon connect, which will mean all subscriptions will need to be renewed, etc., or alternatively, add the ability to reconnect, reusing the session id, and maintaining existing subscriptions, etc.
This seems a little too complex to implement for the 0.12.0 release that is almost ready, but since I considered this issue for it, I thought I'd just document my thoughts on it here...
I'm using this DDP client to run Cucumber tests. In between my tests I close the connection and reopen it, in between which
ddp.collections
is not cleaned. This results in the same documents getting pushed into it multiple times.I currently solve this by doing:
The text was updated successfully, but these errors were encountered: