-
Notifications
You must be signed in to change notification settings - Fork 233
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
Add ability to resubscribe an existing push channel #872
Comments
➤ Jonathan Almeida commented: This sounds like a fair solution with two clarifications:
fun resubscribe(scope: String) { |
➤ Ryan Kelly commented:
I don't know to be honest. I wonder if "forcing registration renewal" should maybe even do an implicit resubscribe to all current push subscriptions, since the problem that's happening with FxA may also be happening elsewhere.
I think it should be fine to do without it if; indeed I can imagine circumstances under which we fail to unsubscribe because state has gotten out of sync between server and client, but re-subscribing will fix it. |
➤ Jonathan Almeida commented: Merging the thread from a-c ( mozilla-mobile/android-components#8846 ) to here since the conversation there on a closed issue and may get lost. This issue is around the same area as well.
Yes, it's the same as this. For now, I've implemented the short-fix specifically for FxA only in order to get Send Tab working and unblock some other folks.
I don't think we would need this outside of the scope of FxA afaict. For web content, we only notify the ServiceWorker ( https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebPushController.java#81 ) that the subscription is no longer valid and let them decide if they want to subscribe again.
That would be an interesting solution!
I think if we can rely on verify_connection to tell subscribers which subscriptions have been changed ( https://github.com/mozilla-mobile/android-components/blob/b7e6ad09e8fb1791ff444a6ef3c5d4d577f317d5/components/feature/push/src/main/java/mozilla/components/feature/push/AutoPushFeature.kt#L284-L291 ) when endpoints are invalid, this should be covering the case of communication between the device and AutoPush servers and we only need to call "subscribe" then. A bit outside scope, but one piece of knowledge is how desktop implements the onSubscriptionChanged event and if we on mobile are doing the right thing by expecting it from verify_connection alone. |
As a result of the discussions in mozilla/application-services#3314, I believe it may be possible for us to get into a situation where:
I'm not sure how we get into such a state, but it fits with observed behaviours.
Assuming that the client finds itself in such a state, the only way it can repair things is to explicitly unsubscribe and then crate a new subscription to send to the FxA server. I think it would be useful to have a
resubscribe
abstraction of some sort to make thing easier.@jonalmeida what do you think?
The text was updated successfully, but these errors were encountered: