-
Notifications
You must be signed in to change notification settings - Fork 125
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
Make Listener.unsubscribe() async for consistency #1300
Comments
I would think most implementations handle this in a fire and forget form currently, and I doubt we'd have objections to making it async. If you agree please update the issue title (say to "Make |
I assume the return type would be |
Related: |
The semantics of awaiting this could be pretty poor as would require null check before await. Also where do you envisage a break? listener.unsubscribe() //Void listener.unsubscribe() //Promise will still result in the same behavior as far as I can see. Though obviously there is no guarantee in either unless you were to await. |
After having an Non breaking from consumer point of view (which is what the versioning is for), breaking from implementors point of view. |
Is going from void -> Promise a breaking change? I wouldn't expect it to be from the point of view of apps. |
Yes thats the conclusion we came to before, for example when |
Question Area
Question
Nearly all of the functions in the api are async and return a
Promise
.Listener.unsubscribe()
is not.I can see that it could well be a fire and forget function but within
BrowserTypes
we haveContextListenerUnsubscribeRequest
,ContextListenerUnsubscribeResponse
,IntentListenerUnsubscribeRequest
andIntentListenerUnsubscribeResponse
.This leads me to assume that when we call
unsubscribe
we need to dispatch a Request message and wait for a Response message. In the meantime we probably aren't unsubscribed.Is this assumption incorrect? Should we unsubscribe immediately before we get the response message? In which case what is the point of the response message?
How do we handle errors with the unsubscribe process?
The text was updated successfully, but these errors were encountered: