Closed Bug 1238785 Opened 8 years ago Closed 8 years ago

Delete health.db after Firefox Health Report is removed from Fennec

Categories

(Android Background Services Graveyard :: Firefox Health Report Service, defect)

All
Android
defect
Not set
normal

Tracking

(firefox48 fixed, fennec48+)

RESOLVED FIXED
Firefox 48
Tracking Status
firefox48 --- fixed
fennec 48+ ---

People

(Reporter: rnewman, Assigned: mcomella)

References

Details

Attachments

(3 files)

Now that FHR is gone, we can delete the existing database file and free up that space.

We have existing bugs to do janitorial work, so let's see if we can kill more than one bird with this stone rather than making a special case.
tracking-fennec: ? → 46+
mcomella, can you take this?

(In reply to Richard Newman [:rnewman] from comment #0)
> Now that FHR is gone, we can delete the existing database file and free up
> that space.
> 
> We have existing bugs to do janitorial work, so let's see if we can kill
> more than one bird with this stone rather than making a special case.

One dead bird is better than no dead birds, let's not block on fixing the world.
Flags: needinfo?(michael.l.comella)
Mike, let's find time to do this.
Assignee: nobody → michael.l.comella
This probably isn't going to happen for 46 at this rate. However, we should definitely do this cleanup to free up that space.
tracking-fennec: 46+ → 47+
This is on my radar and I'm working on a fix.

For reference, I have a profile from January 12th and it takes up the following space:
 72K health.db
 41K health.db-journal
 113K

Not huge, but not insignificant for mobile.
Flags: needinfo?(michael.l.comella)
This is intentionally kept minimal to ensure simplicity.

Review commit: https://reviewboard.mozilla.org/r/45935/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/45935/
Attachment #8740699 - Flags: review?(ahunt)
Attachment #8740700 - Flags: review?(ahunt)
Attachment #8740701 - Flags: review?(ahunt)
This controller is under-featured (e.g. it's not scheduling cleanups for future
dates and it doesn't cache files it already deleted) in favor of simplicity.

Review commit: https://reviewboard.mozilla.org/r/45937/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/45937/
I added some log statements to ensure this worked correctly locally - on a new
profile:
  * Log statements were printed listed the two files I expected to be deleted
and their paths
  * The log statements did not appear after closing and reopened fennec,
meaning the process short-circuited as expected.

Ideally, I'd test that a profile that currently has these files actually gets
them deleted, but it's not easy to create profiles.

The previous patches also contributed unit tests.

Review commit: https://reviewboard.mozilla.org/r/45939/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/45939/
Comment on attachment 8740699 [details]
MozReview Request: Bug 1238785 - Add FileCleanupService. r=ahunt

https://reviewboard.mozilla.org/r/45935/#review43005

Looks reasonable to me!

I was wondering whether we'd want to log when File.delete() fails, but that seems unnecessary to me.
Attachment #8740699 - Flags: review?(ahunt) → review+
You probably want to delete -shm and -wal suffixes, too; they might differ across android versions. Best to catch em all.
Comment on attachment 8740700 [details]
MozReview Request: Bug 1238785 - Add FileCleanupController and tests. r=ahunt

https://reviewboard.mozilla.org/r/45937/#review43015
Attachment #8740700 - Flags: review?(ahunt) → review+
Comment on attachment 8740701 [details]
MozReview Request: Bug 1238785 - Start file cleanup in onStart. r=ahunt

https://reviewboard.mozilla.org/r/45939/#review43017

Looks good to me!
Attachment #8740701 - Flags: review?(ahunt) → review+
(In reply to Richard Newman [:rnewman] from comment #9)
> You probably want to delete -shm and -wal suffixes, too; they might differ
> across android versions. Best to catch em all.

Added. Gotta catch 'em all!
The only users that this affects are long time users (i.e. had FHR). I don't think these users are likely to uninstall Firefox for the several KB of data that we're cleaning up here so I don't feel it's worth uplifting to 47 (we're tracking 47).

Margaret, what do you think?
Flags: needinfo?(margaret.leibovic)
(In reply to Michael Comella (:mcomella) from comment #14)
> The only users that this affects are long time users (i.e. had FHR). I don't
> think these users are likely to uninstall Firefox for the several KB of data
> that we're cleaning up here so I don't feel it's worth uplifting to 47
> (we're tracking 47).
> 
> Margaret, what do you think?

That's a smart way to think about it. I agree, if they haven't given up on Firefox yet, I don't think an extra 6 weeks will make much of a difference.
tracking-fennec: 47+ → 48+
Flags: needinfo?(margaret.leibovic)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: