fenix icon indicating copy to clipboard operation
fenix copied to clipboard

Tie leanplum to Telemetry toggle

Open boek opened this issue 7 years ago • 14 comments

┆Issue is synchronized with this Jira Task

boek avatar Mar 11 '19 18:03 boek

Tested this and Leanplum notifications are still being sent after disabling the Telemetry toggle on all devices.

I've set leanplum to send a notification whenever the app was started or resumed.

Devices & build:

  • Samsung Galaxy Note 8 (Android 9)
  • Samsung Galaxy S8 (Android 9)
  • Nexus 5 (Android 6.0.1)
  • Build: 1.0.1911 (#10731207)
  • log.txt
  • Video

Re-opening the issue.

bsurd avatar Mar 15 '19 12:03 bsurd

Is blocking #864.

bsurd avatar Mar 15 '19 12:03 bsurd

@bsurd https://github.com/mozilla-mobile/fenix/pull/1042 should fix this going forward

boek avatar Mar 19 '19 22:03 boek

Checked on several devices and the issue is still reproducing, after disabling the telemetry switch I am still receiving notifications. Tried starting the app with the toggle disabled by default and notifications were still received. Only when pausing the notification in the dashboard did I not receive them anymore.

Please let me know if you need any other information that could be of help.

Re-opening.

bsurd avatar Mar 27 '19 10:03 bsurd

@bsurd unfortunately Leanplum doesn't offer us a way to stop the service once it has been started in the app. So the grand effect only happens the next time the application is run. When you disable the telemetry toggle in the app we do stop sending events immediately. The next time you start the app Leanplum won't be spun up.

boek avatar Mar 27 '19 16:03 boek

@vesta0 @bbinto would love some input on if this behavior is OK.

boek avatar Mar 27 '19 16:03 boek

This breaks expectation of the toggle. The standard behavior on Android is that a toggle takes effect immediately.

kbrosnan avatar Mar 27 '19 17:03 kbrosnan

@kbrosnan The toggle is working immediately from the aspect of collecting Telemetry. This is referring to using another feature within Leanplum which is sending a push / message to a subset of users which technically still works because Leanplum has been initialized.

The other solution we could do is force-restart the app when the user clicks that toggle which isn't a great experience either. Do you know what Fennec does in this case?

boek avatar Mar 27 '19 18:03 boek

@kbrosnan - do you know how this was implemented for Fennec, I assume that would have the same issue, no?

bbinto avatar Mar 27 '19 18:03 bbinto

Petru-Mugurel Lingurar could clarify the situation since he worked on Leanplum on Fennec. From my knowledge, it's possible to stop the notifications as well. There are some explanations here.

bsurd avatar Mar 28 '19 09:03 bsurd

As Bogdan said on Fennec we do have the option to stop Leanplum altogether, something that was implemented in bug 1454686.

While Leanplum doesn't officially expose APIs for stopping a currently running session we used some internal APIs (public methods) to achieve what we wanted: stop all notifications, in-app banners, telemetry and events tracking - Fennec changeset

I checked with Fenix and I see that here Leanplum is used as an external dependency while on Fennec we actually include the code inside and sprinkle it with our modifications. One important such modification is making Leanplum#stop() public. Otherwise, Leanplum#setIsTestModeEnabled() - the one method that basically disables Leanplum is accessibile in Fenix also.

Mugurell avatar Mar 28 '19 09:03 Mugurell

Removing the QA needed flag, please re-add as soon as this is ready for testing.

bsurd avatar Apr 01 '19 13:04 bsurd

Thanks for the info @Mugurell!

@bsurd This should be working now!

boek avatar Apr 04 '19 16:04 boek

Can confirm, everything works as intended now. Verified on several devices and didn't encounter any other problems.

bsurd avatar Apr 05 '19 08:04 bsurd