Skip to content

Commit

Permalink
It should raise an error when the channel is attaching but immediatel…
Browse files Browse the repository at this point in the history
…y after the detach is invoked
  • Loading branch information
ricardopereira committed Sep 29, 2016
1 parent 3f7055c commit 8013e70
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/ARTRealtimeChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ - (void)transition:(ARTRealtimeChannelState)state status:(ARTStatus *)status {
[_attachedEventEmitter emit:[NSNull null] with:status.errorInfo];
[_detachedEventEmitter emit:[NSNull null] with:status.errorInfo];
}
else if (state == ARTRealtimeChannelDetaching) {
NSString *msg = @"channel is being DETACHED";
[self.realtime.logger debug:__FILE__ line:__LINE__ message:@"R:%p C:%p %@", _realtime, self, msg];
[_attachedEventEmitter emit:[NSNull null] with:[ARTErrorInfo createWithCode:90000 message:msg]];
}

[self emit:(ARTChannelEvent)state with:status.errorInfo];
}
Expand Down

0 comments on commit 8013e70

Please sign in to comment.