RocketChat / Rocket.Chat.js.SDK

Utility for apps and bots to interact with Rocket.Chat via DDP and/or API
MIT License
136 stars 94 forks source link

methodCall not getting rejected #60

Open uncledent opened 5 years ago

uncledent commented 5 years ago

React Native When doing method call on being offline, the call never gets rejected.

return this.sdk.methodCall(
      type ? 'createPrivateGroup' : 'createChannel',
      name,
      users,
      readOnly,
      {},
 { broadcast }
    );

It stays unresolved for ever. Any idea why?

uncledent commented 5 years ago

I see that you reject if connection disconnected in ddp.send metjod

this.once('disconnected', reject);

But the 'disconnected' event is never emitted

uncledent commented 5 years ago

I also can't find the branch with the latest alpha version 25

uncledent commented 5 years ago

I have fixed it here: https://github.com/uncledent/Rocket.Chat.js.SDK/tree/reject-on-ddp-close Please tell me the branch to make a pull request to

diegolmello commented 5 years ago

@uncledent Nice! Open to multiple-clients

uncledent commented 5 years ago

@diegolmello i have created a pull request: https://github.com/RocketChat/Rocket.Chat.js.SDK/pull/61

I would really appreciate if you could push today a new version to the npm as a new alpha! Thank you in advance!