HomePhabricator
Diffusion Comm 526917aee6dd

Schedule blob deletion on Android when large notifications arrives

Description

Schedule blob deletion on Android when large notifications arrives

Summary:
This differential schedules blob deletion on background thread when large notification (notification containing metadata to an item on blob service) arrives. Deletion scheduling is implemented using WorkManager framework - native Android
library that handles persistence, optimal scheduling and retry policy of background tasks out of the box.

Test Plan:

  1. Launch blob service locally
  2. Build android app substituting blob service URL in relevant places
  3. Send large notification (ex. 7000 'x' characters) to the device.
  4. Observe in blob service terminal that 30s after logging GET request, DELETE request is logged and reported successfull.
  5. Build the app again but change the line 38 of DeleteBlobWork.java to sth like "blobhash" (incorrect JSON structure).
  6. Send large notification (ex. 7000 'x' characters) to the device.
  7. Observe in blob service terminal that 30s after logging GET request, DELETE request is logged and reported unsuccessfull.
  8. Finally observe that DELETE request is retried several time - each time after longer period of time but don't wait for the final 10 retry since it will take 17 hours (retries are scheduled according to exponential backoff)

Additionally:

  1. Add line that logs blob holder when deletion is scheduled.
  2. Deploy the app to two different Android devices and send large notification.
  3. Open the app on each device and using console app ensure that each of them logs different holder.

Reviewers: tomek, bartek, atul, kamil, michal, ashoat

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D9069