Android: If `Glean.initialize()` is called outside of the `Application.onCreate()` function, the `baseline.duration.start` won't be called.
Categories
(Data Platform and Tools :: Glean: SDK, defect, P3)
Tracking
(Not tracked)
People
(Reporter: travis_, Unassigned)
Details
(Whiteboard: [telemetry:glean-rs:backlog][docdays])
Since the GleanLifecycleObserver is registered inside of Glean.initialize, if the initialize function is called anywhere outside of the Application.onCreate function then we would miss the onStart event which calls GleanBaseline.duration.start. This would cause stop to be called without start and generate a Glean error.
| Reporter | ||
Comment 1•6 years ago
|
||
This looks like it could happen in Fenix now, if the telemetry preference was toggled off and the app was closed, and the the pref was toggled back on. Since the TelemetryService wrapper is started when the pref is enabled, this calls Glean.initialize after the onStart event has already transpired.
Updated•6 years ago
|
Comment 2•5 years ago
|
||
While I agree this can be possible, we document that Glean should be initialized as soon as possible within the onCreate. I'm not sure if there's anything else we could do here.
Thoughts?
| Reporter | ||
Comment 3•5 years ago
|
||
I agree, I don't think the small cohort of users who might do this will affect data very much. Just a good thing to note that we might see some null values or errors because of this.
| Reporter | ||
Comment 4•5 years ago
|
||
Since we do document this, I'm closing this as INVALID.
Description
•