Closed Bug 838877 Opened 11 years ago Closed 11 years ago

Change policy handling to permit direct pref modification

Categories

(Firefox Health Report Graveyard :: Client: Desktop, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

Attachments

(1 file, 1 obsolete file)

We recently changed this so that enabling or disabling went through a function call, so that we can schedule a remote deletion.

This isn't well suited for Android: we don't want to ship the JS Bagheera client, the Gecko side of FHR won't even know the document ID, and our life is easier if we can mirror the pref directly.

We'd like to switch to using pref observers, which also buys us correct behavior if a user pokes around in about:config.

The function call can stay for convenience access.
Blocks: 833625
Blocks: 838879
Attached patch Proposed patch. v1 (obsolete) — Splinter Review
Watch the upload enablement pref, deleting accordingly.

I think this is the only pref we change from the UI that requires observation. Might find more as we go.
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Attachment #712640 - Flags: review?(gps)
Note that we don't have an end-of-lifecycle component for the policy object, so it doesn't unhook its observer.
The previous version broke a single test, which was expecting pref changes to not cause a deletion -- an outstanding deletion will cause updates to be delayed.
Attachment #712640 - Attachment is obsolete: true
Attachment #712640 - Flags: review?(gps)
Attachment #713156 - Flags: review?(gps)
Comment on attachment 713156 [details] [diff] [review]
Proposed patch. v2

Review of attachment 713156 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me.

::: services/datareporting/policy.jsm
@@ +710,5 @@
> +    let result = null;
> +    if (!flag) {
> +      result = this.deleteRemoteData(reason);
> +    }
> +      

If you are going to change style only, please don't introduce leading whitespace :P
Attachment #713156 - Flags: review?(gps) → review+
https://hg.mozilla.org/services/services-central/rev/430b8f9868f8

There might be more once Chenxia's done with UX.
Whiteboard: [fixed in services]
https://hg.mozilla.org/mozilla-central/rev/430b8f9868f8
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in services]
Target Milestone: --- → mozilla21
Component: Metrics and Firefox Health Report → Client: Desktop
Product: Mozilla Services → Firefox Health Report
Target Milestone: mozilla21 → Firefox 21
Product: Firefox Health Report → Firefox Health Report Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: