Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECO-4838] Attach according to RTL7c #1935

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Source/ARTRealtimeChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,17 @@ - (BOOL)canBeReattached {
}
}

- (BOOL)shouldAttach {
switch (self.state_nosync) {
case ARTRealtimeChannelInitialized:
case ARTRealtimeChannelDetaching:
maratal marked this conversation as resolved.
Show resolved Hide resolved
case ARTRealtimeChannelDetached:
return YES;
default:
return NO;
}
}

- (ARTErrorInfo *)errorReason_nosync {
return _errorReason;
}
Expand Down Expand Up @@ -435,7 +446,7 @@ - (ARTEventListener *)subscribeWithAttachCallback:(ARTCallback)onAttach callback
ARTLogWarn(self.logger, @"R:%p C:%p (%@) subscribe has been ignored (attempted to subscribe while channel is in FAILED state)", self->_realtime, self, self.name);
return;
}
if (self.state_nosync == ARTRealtimeChannelInitialized) { //RTL7c
if (self.shouldAttach) { // RTL7c
[self _attach:onAttach];
}
listener = [self.messagesEventEmitter on:cb];
Expand Down
Loading