-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix: should attach if the channel is in the FAILED state #507
Conversation
Oh my, this has been already fixed by @EvgenyKarkan with #497. |
@ricardopereira sorry, it seems I missed this thread (
yes, I did a try to fix #485 , but Toni detected regression which I did not investigate yet (is it legacy or not). |
72b3cce
to
e2e1866
Compare
The change I did for
I think "Implicitly attaches the Channel if the channel is in the INITIALIZED state. However, if the channel because
|
@mattheworiordan PTAL |
@ricardopereira I'm not against your proposal per se, but why can't we just stick to what RTP11b says, as is? If the change you did for RTL4g broke the RTP11b test, shouldn't we fix our RTP11b implementation rather than changing the RTP11b spec? |
@tcard I did fix RTP11b. It's working fine now but when I revisited the RTP11b spec I noticed that some parts were inconsistent. Like I said before, the RTP11b states that if the channel is in DETACHED or FAILED state then the operation should result in an error and that's not what should be happening. |
There is a good reason for this behaviour. If the channel, in the 0.9 spec, is in the FAILED state it is terminal. If it is in the DETACHED state, then the user has explicitly set it to DETACHED (the server never moves it to DETACHED, only to SUSPENDED now). So if a channel is in a terminal state, we should not implicitly try and fix that. They should be trying to fix that explicitly. If the channel has been explicitly detached by the user, and they call get, then we should not implicitly attach again as the implicit attach is ONLY a convenience for initialized channels to save the user having to explicitly attach before doing an operation. That implicit attach never happens again because the convenience opportunity has passed. So I believe the spec is indeed right as it stands as we don't want implicit actions unless the channel is initialized. |
@mattheworiordan Thanks, understood. I will write the missing parts of the spec. |
a9895b1
to
e9a7cc5
Compare
@mattheworiordan PTAL to the changes I made. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(BTW, I thought I would die before seeing the CI build passing again! Feels nice.)
case ARTRealtimeChannelFailed: | ||
if (callback) callback(nil, [ARTErrorInfo createWithCode:0 message:msg]); | ||
return; | ||
case ARTRealtimeChannelDetached: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick: you can do
case ARTRealtimeChannelFailed:
case ARTRealtimeChannelDetached:
if (callback) callback(nil, [ARTErrorInfo createWithCode:0 message:msg]);
return;
and save yourself two lines :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 Damn, you're right. Forgot about the fallthrough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed 👍
e9a7cc5
to
70bf363
Compare
Autosquashed. |
#485
Please only merge if all tests are passing.
This can break other tests like
RTP11b
.