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:
- Launch blob service locally
- Build android app substituting blob service URL in relevant places
- Send large notification (ex. 7000 'x' characters) to the device.
- Observe in blob service terminal that 30s after logging GET request, DELETE request is logged and reported successfull.
- Build the app again but change the line 38 of DeleteBlobWork.java to sth like "blobhash" (incorrect JSON structure).
- Send large notification (ex. 7000 'x' characters) to the device.
- Observe in blob service terminal that 30s after logging GET request, DELETE request is logged and reported unsuccessfull.
- 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:
- Add line that logs blob holder when deletion is scheduled.
- Deploy the app to two different Android devices and send large notification.
- 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