Closed Bug 1260519 Opened 4 years ago Closed 4 years ago
Support unsubscribing from Push API messages from a site
58 bytes, text/x-review-board-request
Right now, it's a big TODO: https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/push/PushService.java#291. The functionality is all in place, just need to wire up the messages. Testing this is the hardest part.
This was implemented, but never wired up. I thought long and hard about how to unit test this, and it's quite difficult. First, we'd have to chose a layer of testing. We could unit test: * the JS <-> Java message passing; * the permission prompts <-> JS interface; * some interactions with the Service Worker interface. The first is difficult because none of our current testing emulators have Google Play Services and GCM enabled, so we'd need to allow to mock or otherwise fake the GCM registration. Then we'd need to stand up a mock autopush server (using httpd.js or the Java-side equivalent), or mock out the autopush client as well. At this point, we're testing sendMessage. This could be done, but I'd rather slide this fix in before building out quite a bit of test infrastructure. (For the record, the Java Push Service state machine is thoroughly tested with Java unit tests, so I have confidence that the unsubscribe logic works.) The second is tested via the PushWebSocket tests, which are now running on Android. That is, if permissions and the PushService are interacting badly, we should see it with the existing test suite. Since PushServiceAndroidGCM is pretty much a pass-through, there's little value to be added here. Finally, the third is also tested via the PushWebSocket tests. There's absolutely nothing GCM specific about the Service Worker interface to the PushService. So I'm left manually testing this -- and now we can unsubscribe from Push messages from sites. Review commit: https://reviewboard.mozilla.org/r/43117/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/43117/
Attachment #8736133 - Flags: review?(nchen)
Comment on attachment 8736133 [details] MozReview Request: Bug 1260519 - Support unsubscribing from Push API messages from a site. r?jchen https://reviewboard.mozilla.org/r/43117/#review39833
Attachment #8736133 - Flags: review?(nchen) → review+
https://hg.mozilla.org/integration/fx-team/rev/1b9a489995479fb498c61857cc9311d81a88257e Bug 1260519 - Support unsubscribing from Push API messages from a site. r=jchen
Summary: Support unregistering from Push API messages from a site → Support unsubscribing from Push API messages from a site
You need to log in before you can comment on or make changes to this bug.