Closed Bug 1508965 Opened 6 years ago Closed 6 years ago

Use a background job to upload pings

Categories

(Toolkit :: Telemetry, enhancement, P1)

enhancement
Points:
3

Tracking

()

RESOLVED FIXED
Tracking Status
firefox65 --- affected

People

(Reporter: Dexter, Assigned: travis_)

References

Details

(Whiteboard: [telemetry:mobilesdk:m5])

Attachments

(2 files)

> Right now we are performing uploads immediately [1]. For the final version we > probably want to schedule a background job for that (via `WorkManager` [2]) that will > take care of that even if the app gets killed and also retries in error situations. > > You tell it the constraints you want to run your backgorund job in (e.g. I need > network, I don't want to do this in low-battery situations, I want the following > re-try policy etc.). It will then take care of executing your job and you just > need to tell it whether you've completed successfully or not. [1] - https://github.com/mozilla-mobile/android-components/blob/2b4f71087680f71d47a5a5e73d522bda910ea69e/components/service/glean/src/main/java/mozilla/components/service/glean/Glean.kt#L148-L150 [2] - https://developer.android.com/topic/libraries/architecture/workmanager/
Blocks: 1491345
Points: --- → 3
Priority: -- → P3
Whiteboard: [telemetry:mobilesdk:m?]
Assignee: nobody → tlong
Whiteboard: [telemetry:mobilesdk:m?] → [telemetry:mobilesdk:m5]
Blocks: 1525603
Priority: P3 → P1

We discussed this a bit and wrote a bit of notes about it :) https://docs.google.com/document/d/1D6jACr9suJQ2y6FSonrHPifMZoOKYJ0DcB-DuU1IE5Y/edit

Attached file GitHub Pull Request

Adding Github PR. This ended up refactoring a bit more than I expected but I think it makes things cleaner in the end.

Blocks: 1529611
Blocks: 1529613
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED

This PR caused unit tests for glean to become flaky. Re-opening until I can find a solution. Was given some great things to try for data visiblity from Sebastian here

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached file GitHub Pull Request

This is the second attempt at this, backing out the refactor and this contains a workaround for WorkManager, which we discovered has a bug related to triggering it in tests (thanks Alessio!).

Finally fixed and re-merged!

Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: