Skip to content

Commit

Permalink
fix(realtime): Fixed bug in RealTimeClient's message handling for sub…
Browse files Browse the repository at this point in the history
…scriptions (#30)
thzinc authored Nov 27, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 20d8576 commit a6a06cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/RealTimeClient.js
Original file line number Diff line number Diff line change
@@ -156,14 +156,14 @@ class RealTimeClient {
break;
case messages.SUBSCRIPTION_START.FAILURE:
{
const { subscriptionStartRejecter } = this.openRequests[message.request_id];
const { subscriptionStartRejecter } = this.openRequests[message.request_id] || {};
subscriptionStartRejecter(message);
delete this.openRequests[message.request_id];
}
break;
case messages.SUBSCRIPTION_END.SUCCESS:
{
const { subscriptionEndResolver } = this.subscriptions[message.subscription_id];
const { subscriptionEndResolver } = this.subscriptions[message.subscription_id] || {};
if (subscriptionEndResolver) {
subscriptionEndResolver(message);
delete this.subscriptions[message.subscription_id];
@@ -172,7 +172,7 @@ class RealTimeClient {
break;
case messages.SUBSCRIPTION_END.FAILURE:
{
const { subscriptionEndRejecter } = this.subscriptions[message.subscription_id];
const { subscriptionEndRejecter } = this.subscriptions[message.subscription_id] || {};
if (subscriptionEndRejecter) {
subscriptionEndRejecter(message);
}

0 comments on commit a6a06cf

Please sign in to comment.