data is still collected after setting metrics.upload.enable to false

RESOLVED FIXED

Status

Toolkit Graveyard
Data Collection/Metrics
RESOLVED FIXED
12 years ago
7 years ago

People

(Reporter: Brian Ryner (not reading), Assigned: Brian Ryner (not reading))

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

12 years ago
Setting this pref to false should put us in the same state as if it was never set to true -- that is, all collection should be stopped.
(Assignee)

Comment 1

12 years ago
Created attachment 228963 [details] [diff] [review]
patch

This patch clears out the config and data file, and stops all collectors, when we find the pref to be disabled.  I do this on startup, in addition to on pref-change notification, in case the pref was edited by hand.
Attachment #228963 - Flags: first-review?(marria)

Comment 2

12 years ago
Comment on attachment 228963 [details] [diff] [review]
patch


>+  nsCOMPtr<nsIFile> configFile;
>+  GetConfigFile(getter_AddRefs(configFile));
>+  if (configFile) {
>+    configFile->Remove(PR_FALSE);
>+  }
>+
>+  nsCOMPtr<nsILocalFile> dataFile;
>+  GetDataFile(&dataFile);
>+  if (dataFile) {
>+    dataFile->Remove(PR_FALSE);
>+  }

Does it make sense to check if these files exist before removing them? (Not sure it matters)


>+  if (!CollectionEnabled()) {
>+    MS_LOG(("Upload disabled or URI not set"));
>+    return NS_ERROR_ABORT;
>+  }

Fix logging to say only that upload is disabled

otherwise looks good
Attachment #228963 - Flags: first-review?(marria) → first-review+
(Assignee)

Comment 3

12 years ago
(In reply to comment #2)
> Does it make sense to check if these files exist before removing them? (Not
> sure it matters)

I think that would actually be more expensive and not gain us anything.
(Assignee)

Comment 4

12 years ago
checked in
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
(Assignee)

Comment 5

12 years ago
*** Bug 341785 has been marked as a duplicate of this bug. ***

Updated

7 years ago
Component: Data Collection/Metrics → Data Collection/Metrics
Flags: first-review+
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.