-
Notifications
You must be signed in to change notification settings - Fork 24
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
Completion handler never called in clearAllState(completion:)
#186
Comments
An update: I'm seeing the same behavior on calling I haven't done extensive testing but this is happening consistently in the Xcode 15 simulator. I have to assume it's not happening on real devices, otherwise no one would be able to sign in/out of our app since we make these calls to the Pusher SDK as part of those flows. Have you gotten any reports from other folks seeing similar behavior? |
The xCode Simulator doesn't support Push Notifications and so the library functionality can't be guaranteed. If you are not seeing this on live devices I would suggest the cause of the issue here is the simulator and not our library. |
If that's the case, then I would suggest adding some conditions to detect the simulator environment and still call the callback the same way it would be in production. Leaving the callback silently un-called would be unexpected behavior in any circumstance, simulator or not. Another option would be to print a warning or raise an exception (or call the callback with an error) if the callback-using methods are invoked in the simulator environment. Or even better (and this would be a benefit on live devices as well, a built-in timeout after which the callback is called with an error. If I got bitten by this, I'm probably not the only one. If nothing else, a note in the documentation around these methods would give folks some warning that these methods may not behave as expected in the simulator environment. |
I am running this on a live device, using a react native project and the completion handlers for both |
I'm calling
clearAllState
upon user logging out, as recommended in the docs. I've noticed that the completion handler is not being called, which at least in my current implementation results in the log-out process hanging, since it never continues past the step where I clear all Pusher state.Is it expected that the
clearAllState
completion handler will sometimes (or every time in my case) not get called?If so it would be great to call that out in the documentation so that folks don't get tripped up on this in the future like I did.
The text was updated successfully, but these errors were encountered: