Closed Bug 1045887 Opened 10 years ago Closed 4 years ago

Implement a simple janitor for deleting stale files

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: rnewman, Unassigned, Mentored)

References

Details

This should be as simple as moving through monotonically increasing integers, just like DB migrations, taking cleanup actions at each step. We can trigger this in a background thread in onPause, or after delayed startup -- we can decide on "urgency" by looking at how big a gap we have to that integer. I can mentor this for an advanced contributor, or I'll attack it myself.
To remove: Periodic: * Stale crash reports: Bug 942612. One-time: * Cache directory: Bug 1045886 * netpredictions.sqlite*: Bug 1045884 * addons.sqlite, extensions.sqlite: Bug 966707 * Stale unsalted profiles: Bug 1015236 * Product Announcements prefs: Bug 1045278
We could also delete stale Sync profile prefs. If we wanted to do something a little more extensible, we could broadcast an intent and make it easy to implement a clean-up action off in some isolated component.
Mentor: nalexander
Could anyone elaborate about the bug, and what we need to do in the bug ? Also provide some mxr/dxr links if possible. Thanks!!
This is a pretty advanced bug, so be aware! Periodically we want to clean up some sets of files. This can be triggered by app lifecycle events combined with (range-checked) times. Once only, we want to delete another list of files. The best way to do that is a version step -- see, for example, the way ProfileInformationCache or BrowserDatabaseHelper works. We'd start at zero, have a destination of 1, and the 0->1 transition would involve deleting the things in Comment 1. The 'janitor' is the component that does these two things in response to lifecycle events and its own state.
Depends on: 1238785
bug 1238785 implemented a CleanupService that doesn't keep track of what it's deleted and always tries to delete everything. We could repurpose that code to be more intelligent here and do the remaining cleanup actions indicated above.
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.