Meteor reconnecting / autoreconnecting and data sync

Hey all. I’m looking at the current DDP server implementation right now and was wondering if someone else has already tackled the problem that if a client disconnect’s and then reconnects and re-subscribes, the server will re-send all of the records again.

I would like to tackle this problem, because I want to prevent the server from sending data on after SSR on hydration. Currently fast-render prevents a re-render by fooling the ready state of the subscription, but the server still sends the subscription records over the wire. I want to fix that.

One of the options is to store a reference to the SessionCollectionView on the client side. That way if the client disconnects, Meteor would still cleanup the session, but when the client reconnects, it sends a reference to the SessionCollectionView and Meteor then somehow needs to understand that original state of the view. It could be a cache mechanism per session where it keeps the cache for n seconds / minutes in case a client re-connects. That would however not work for server restarts unless we cache somewhere else.

Any people that gave some thoughts on this?

1 Like