-
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
[SDK-1181] Setting clientId again. #1842
Conversation
…g further calls to `activate` until app relaunch or re-auth to Ably. Fixing it by setting clientId again whenever accessing the local device.
3cd914e
to
e39aa05
Compare
e39aa05
to
edf9942
Compare
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.
It looks like this PR is implementing RSH8b, which describes how and when the LocalDevice
’s clientId
should be populated.
Assuming that we're not currently conforming to RSH8b, that presumably means that we must be currently populating LocalDevice.clientId
in some non spec-conforming way. Is that right? If so, should we not remove it?
Source/ARTPushActivationState.m
Outdated
@@ -117,6 +118,12 @@ - (ARTPushActivationState *)transition:(ARTPushActivationEvent *)event { | |||
} | |||
else if ([event isKindOfClass:[ARTPushActivationEventCalledActivate class]]) { | |||
[self.machine registerForAPNS]; | |||
#if TARGET_OS_IOS | |||
ARTLocalDevice *const local = self.machine.rest.device_nosync; | |||
if ([local clientId] == nil) { |
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.
Why the nil check? RSH8b doesn't describe this.
…ar device details) and only resets clientId, since it affects push device registration with a different clientId (after deregistration with previous clientId). This only affects clients that do not restart their apps after deregistration, since clientId is loaded into deviceId once per app launch. This commit resets clientId after deregistration." This reverts commit bff9205.
Seems like according to RSH3a2a1 different |
I don't know what you mean by "different |
I thought that in order to address the issue that you described in the PR description, your PR intended to implement RSH8b properly. Have I missed something? |
RSH3a2a1: "if the LocalDevice has a non-empty clientId, and the present identified client has a different (non-null) clientId" which I guess explicitly means that if the |
RSH3a2a1 is executed "if the local device has |
@maratal @lawrence-forooghian I am not sure that the bug is covered by spec. I guess the problem is that spec says:
Customer creates several Ably instances with different Does it make sense to you guys? Can we check P.S. I think that |
TBH I didn't understand this statement, because what What this PR was initially intended to do, is to fix the first PR that was just resetting Re RSH3a2a1, there are few tests, that began to fail repeatedly, and I've made erroneous assumption about RSH3a2a1, sorry 🤦♂️ Now I think that the best option would be to resurrect the old PR which makes full reset device details and address users complains about it accordingly. |
Ok, now I see what you've meant here re RSH8b @lawrence-forooghian |
I think that my old message that Marat linked to above does the best job of explaining this. RSH8b describes when the
Yes, this was us implementing RSH3g2a, right? But that spec point needs to be implemented alongside RSH8b. As far as I can tell, as long as we're properly implementing RSH8b and RSH3g2a, we shouldn't have any problems. Have I missed something? |
I think that those specs should be implemented in different PRs, but shouldn't be shipped separately (release should contain them both). |
Sure, we can fix them however we want. But do you agree that all we need to do is make sure we're correctly implementing those two spec points and this whole issue should go away? |
Yes, agreed, but I think that as long as the user is properly deactivating one clientId before starting to use a different one, then it's OK right? |
Well, at least it looks like that. |
Closed in favor of #1847 |
After clientId has been reset on
deactivate
, it will benil
during further calls toactivate
until app relaunch or re-auth to Ably. Fixing it by setting clientId from options again on device activation.