Closed Bug 1594032 Opened 6 years ago Closed 5 years ago

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)

defect

Tracking

(Not tracked)

RESOLVED INVALID

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.

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.

Whiteboard: [telemetry:glean-rs:m?] → [telemetry:glean-rs:backlog][docdays]

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?

Flags: needinfo?(tlong)

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.

Flags: needinfo?(tlong)

Since we do document this, I'm closing this as INVALID.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.