mozilla-lockwise / lockwise-android

Firefox's Lockwise app for Android
https://mozilla-lockwise.github.io/lockwise-android/
Mozilla Public License 2.0
623 stars 104 forks source link

When used for Autofill, Glean pings are not triggered #1179

Open travis79 opened 4 years ago

travis79 commented 4 years ago

What / Requirements

While validating Glean baseline pings against the existing core ping and events, I noticed that there are cases where the app doesn't see the foreground and background application lifecycle events. I assume this is when the application is being used for Autofill by the OS and is being invoked more like a service than an app (please correct me if I am wrong). Glean relies on the start/stop events to trigger some things like starting of timers like duration, and for triggering ping uploads. This means that Glean is only sending a baseline ping on the times when the user actually launches the app and we see the foreground/background events.

My question, then, is how would we like to proceed? Are the instances when the app is used by Autofill to be considered as 'foreground sessions' and treated as such by the app/telemetry? Meaning: we should find a way to get similar behavior to when the app is run in these cases. Or, does the invocations of the application by Autofill need to be treated differently?

Basically this boils down to how Glean recommends calculating dau from the baseline ping. If Lockwise activity via Autofill should be counted for dau, then we need to make adjustments to get the behavior of these to generate a baseline ping or other way to include them in counts. If the Autofill activity is not to be counted towards dau, and just users launching the app, then we are good for the baseline ping, but may want to add instrumentation to account for Autofill invocations.

Currently, it appears that the core ping is being sent for both Autofill invocations when the app isn't launched by the user, and for app launches when going to the background. This means that the current dashboards I found are calculating dau/mau/wau based on the usage of the app and of Autofill invocations.

Pinging @magorlick on this for a data-science perspective, and @sandysage for the Lockwise perspective.

travis79 commented 4 years ago

We are tracking this from the Glean side of things via Bug 1617243