oortcloud / node-ddp-client

A callback style DDP (Meteor's Distributed Data Protocol) node client.
Other
263 stars 80 forks source link

Fix ignored sends when server is disconnected #90

Closed lightpriest closed 7 years ago

lightpriest commented 7 years ago

When the server is offline, a ddpclient.send would effectivley be ignored. The callbacks would still be registered, and the messages are lost. The behavior is described in more detail here vsivsi/meteor-job-collection#203.

This patch makes send requests callback with errors if the server is not connected. There is a small exception to the "connect" message, which obviously shouldn't be blocked.

vsivsi commented 7 years ago

Looks good to me. Merging now. I will try to publish to npm over the weekend.