Closed
Bug 944242
Opened 11 years ago
Closed 11 years ago
[OTA][Data Migration][Do Not Track] "Do Not Track" radio button options is not selected after update from v1.1 to v1.2
Categories
(Firefox OS Graveyard :: Gaia::Settings, defect)
Tracking
(blocking-b2g:koi+, b2g18 unaffected, b2g-v1.1hd unaffected, b2g-v1.2 fixed, b2g-v1.3 fixed)
RESOLVED
FIXED
blocking-b2g | koi+ |
Tracking | Status | |
---|---|---|
b2g18 | --- | unaffected |
b2g-v1.1hd | --- | unaffected |
b2g-v1.2 | --- | fixed |
b2g-v1.3 | --- | fixed |
People
(Reporter: hlu, Assigned: gsvelto)
References
Details
(Keywords: dataloss, regression)
Attachments
(5 files, 3 obsolete files)
* Build Information
Gaia: 92cd11ea023dd6598d82d859ae3c945ff6589ce6
Gecko: http://hg.mozilla.org/releases/mozilla-b2g26_v1_2/rev/14e91ab12441
BuildID 20131127004001
Version 26.0
ro.build.version.incremental=eng.cltbld.20131127.073824
* Reproduce Steps
1. Flash device to v1.1 build from PVT
2. Change update URL to http://update.boot2gecko.org/unagi/1.2.0/nightly/update_20131127004001.xml
3. Open Settings -> Do Not Track
4. Enable "Do Not Track" radio butoon.
5. Download the update package and install the update.
* Actual results:
1. After update, none of "Do Not Track" radio button is selected.
* Expected result:
1. The option that Do Not track should be selected.
Reporter | ||
Comment 1•11 years ago
|
||
Reporter | ||
Comment 2•11 years ago
|
||
Reporter | ||
Updated•11 years ago
|
Summary: [OTA]Data Migration][Do Not Track] "Do Not Track" radio button options is not selected after update from v1.1 to v1.2 → [OTA][Data Migration][Do Not Track] "Do Not Track" radio button options is not selected after update from v1.1 to v1.2
Comment 3•11 years ago
|
||
Besides the fact that this is data loss, this has bad privacy impact, as a user would expect do not track to be enabled post the update until they happen to stumble upon the fact that the setting was flipped.
Reporter | ||
Updated•11 years ago
|
Blocks: 1.2-data-migration
Comment 4•11 years ago
|
||
Arthur, could you help to take a look on this issue?
Thank you :)
Flags: needinfo?(arthur.chen)
Assignee | ||
Comment 6•11 years ago
|
||
Sure, I'll take it.
Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Flags: needinfo?(gsvelto)
Assignee | ||
Comment 7•11 years ago
|
||
I need to know which v1.1 PVT build was used because I'm not having much luck finding one that works on my Unagi :-|
Flags: needinfo?(hlu)
Reporter | ||
Comment 8•11 years ago
|
||
The build file link path is in below.
https://pvtbuilds.mozilla.org/pub/mozilla.org/b2g/nightly/mozilla-b2g18-unagi-eng/2013/11/2013-11-27-04-12-03/
Flags: needinfo?(hlu)
Comment 9•11 years ago
|
||
(In reply to Preeti Raghunath(:Preeti) from comment #5)
> Gabriele,
>
> Can you please take a look at this bug?
Switching to koi+ per triage
blocking-b2g: koi? → koi+
Assignee | ||
Comment 10•11 years ago
|
||
I've successfully reproduced this going from v1.1 to v1.2, I believe this also applies to master.
Assignee | ||
Comment 11•11 years ago
|
||
Verified on master too. The problem is fairly trivial and I've got a patch almost ready: on v1.1 we only had the 'privacy.donottrackheader.enabled' setting, while v1.2 introduced 'privacy.donottrackheader.value'. The latter is set by default to -1 which means "No preference". The relevant code does not further check the value of 'privacy.donottrackheader.enabled' so even if it is set to 'true' it will still appear in the panel as if DNT was not enabled.
Assignee | ||
Comment 12•11 years ago
|
||
This patch detects the condition where 'privacy.donottrackheader.value' do not exists and reacts according to the presence/value of 'privacy.donottrackheader.enabled':
- if 'privacy.donottrackheader.enabled' is true, then 'privacy.donottrackheader.value' is sets to 1 (do not track enabled)
- if 'privacy.donottrackheader.value' is false or undefined then 'privacy.donottrackheader.value' is set to -1 (no preference)
I've tested the code by trying the three different upgrade paths on my Unagi.
Attachment #8342535 -
Flags: review?(kaze)
Assignee | ||
Updated•11 years ago
|
Comment 13•11 years ago
|
||
Because 1.2 is going to be finished, should we mark this bug from koi+ to 1.3+? Thanks.
Assignee | ||
Comment 14•11 years ago
|
||
Review ping.
Comment 15•11 years ago
|
||
Comment on attachment 8342535 [details] [diff] [review]
[PATCH] Properly handle do-not-track options when upgrading from 1.1
Review of attachment 8342535 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM except for the `if (enabled === null)` detail.
Sorry for my super-late review, this bug went off my radar. I promise I won’t miss your patch update.
::: apps/settings/js/do_not_track.js
@@ +1,5 @@
> /* -*- Mode: js; js-indent-level: 2; indent-tabs-mode: nil -*- */
> /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
>
> +/* globals Settings */
> +
nit: what does this coment mean?
@@ +23,2 @@
> return;
> + }
<3
@@ +64,2 @@
> return;
> + }
Warning, this has a different result than the original `enable == null` test, and it will never occur. I guess the original author meant:
if (!(result.settingValue in enabledMap)) {
return;
}
var enabled = enabledMap[result.settingValue];
or:
var enabled = enabledMap[result.settingValue];
if (enabled === undefined) {
return;
}
We probably should log a warning or generate an exception in such a case, BTW.
Attachment #8342535 -
Flags: review?(kaze) → review-
Comment 16•11 years ago
|
||
Ugh, there’s not enough context for my comment. This is the part of your patch I’m talking about:
var enabled = enabledMap[result.settingValue];
- if (enabled == null)
+ if (enabled === null) {
return;
+ }
Assignee | ||
Comment 17•11 years ago
|
||
(In reply to Fabien Cazenave [:kaze] from comment #15)
> Sorry for my super-late review, this bug went off my radar. I promise I
> won’t miss your patch update.
No problem and thanks for the review. I'll post the updated patch ASAP.
> ::: apps/settings/js/do_not_track.js
> @@ +1,5 @@
> > /* -*- Mode: js; js-indent-level: 2; indent-tabs-mode: nil -*- */
> > /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
> >
> > +/* globals Settings */
> > +
>
> nit: what does this comment mean?
It is used to inform jshint that the 'Settings' symbol is available globally and quiets all jshint warnings related to it. I've been consistently running 'make hint' on the files I modify and progressively addressing all the warnings; the final objective is to be able to enable jshint by default on Travis which can help us catch all sorts of issues before we land.
> Warning, this has a different result than the original `enable == null`
> test, and it will never occur.
Ah, right, because `undefined == null` is true but `undefined === null` is not. I'm still a newbie when dealing with these JS subtleties :-) I'll check for undefined instead and log a warning as you suggested.
Assignee | ||
Comment 18•11 years ago
|
||
Attachment #8342535 -
Attachment is obsolete: true
Attachment #8348692 -
Flags: review?(kaze)
Assignee | ||
Comment 19•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Attachment #8348692 -
Attachment description: [PATCH] Properly handle do-not-track options when upgrading from 1.1 → [PATCH v2] Properly handle do-not-track options when upgrading from 1.1
Comment 20•11 years ago
|
||
Comment on attachment 8348692 [details] [diff] [review]
[PATCH v2] Properly handle do-not-track options when upgrading from 1.1
Thanks for the quick update. LGTM but Travis is red:
> test_enable_do_not_track_via_settings_app (test_settings_do_not_track.TestSettingsDoNotTrack)
> Enable do not track via the Settings app ... FAIL
> ======================================================================
> FAIL: None
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/usr/local/lib/python2.7/dist-packages/marionette_client-0.7.1-py2.7.egg/marionette/marionette_test.py", line 143, in run
> testMethod()
> File "/home/travis/build/mozilla-b2g/gaia/tests/python/gaia-ui-tests/gaiatest/tests/functional/settings/test_settings_do_not_track.py", line 29, in test_enable_do_not_track_via_settings_app
> self.assertEqual(self.data_layer.get_bool_pref('privacy.donottrackheader.enabled'), True)
> TEST-UNEXPECTED-FAIL | test_settings_do_not_track.py test_settings_do_not_track.TestSettingsDoNotTrack.test_enable_do_not_track_via_settings_app | AssertionError: False != True
> ----------------------------------------------------------------------
> Ran 1 test in 10.288s
> FAILED (failures=1)
Naive and unrelated question: why do you submit a text patch *and* a github PR? Wouldn’t the latter be enough?
(In reply to Gabriele Svelto [:gsvelto] from comment #17)
> because `undefined == null` is true but `undefined === null` is not
Aren’t we living in a wonderful world? :-)
Assignee | ||
Comment 21•11 years ago
|
||
(In reply to Fabien Cazenave [:kaze] from comment #20)
> Thanks for the quick update. LGTM but Travis is red:
>
> > test_enable_do_not_track_via_settings_app (test_settings_do_not_track.TestSettingsDoNotTrack)
> > Enable do not track via the Settings app ... FAIL
> > ======================================================================
> > FAIL: None
> > ----------------------------------------------------------------------
> > Traceback (most recent call last):
> > File "/usr/local/lib/python2.7/dist-packages/marionette_client-0.7.1-py2.7.egg/marionette/marionette_test.py", line 143, in run
> > testMethod()
> > File "/home/travis/build/mozilla-b2g/gaia/tests/python/gaia-ui-tests/gaiatest/tests/functional/settings/test_settings_do_not_track.py", line 29, in test_enable_do_not_track_via_settings_app
> > self.assertEqual(self.data_layer.get_bool_pref('privacy.donottrackheader.enabled'), True)
> > TEST-UNEXPECTED-FAIL | test_settings_do_not_track.py test_settings_do_not_track.TestSettingsDoNotTrack.test_enable_do_not_track_via_settings_app | AssertionError: False != True
> > ----------------------------------------------------------------------
> > Ran 1 test in 10.288s
> > FAILED (failures=1)
I'll see if I can reproduce this locally.
> Naive and unrelated question: why do you submit a text patch *and* a github
> PR? Wouldn’t the latter be enough?
Yeah but I prefer to have the patch for review so all the review comments are on Bugzilla instead of Github (as well as the final patch) and then use the PR for Travis.
Assignee | ||
Comment 22•11 years ago
|
||
Here's the updated patch with the test breakage fixed, I had made a completely silly mistake in the settings cset constructor I assumed that this:
var kEnabledKey = "privacy.donottrackheader.enabled"
{ kEnabledKey: enabled }
Would yield
{ "privacy.donottrackheader.enabled": enabled }
Which it quite obviously doesn't :-)
Attachment #8348692 -
Attachment is obsolete: true
Attachment #8348692 -
Flags: review?(kaze)
Attachment #8348838 -
Flags: review?(kaze)
Comment 23•11 years ago
|
||
I confess I fell into this one once, too. :-)
Comment 24•11 years ago
|
||
Comment on attachment 8348838 [details] [diff] [review]
[PATCH v3] Properly handle do-not-track options when upgrading from 1.1
Review of attachment 8348838 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
::: apps/settings/js/do_not_track.js
@@ +67,3 @@
>
> var lock = settings.createLock();
> + var cset = { 'privacy.donottrackheader.enabled': enabled };
Nitpick, in such cases we often use that:
var cset = {};
cset[kEnabledKey] = enabled;
Attachment #8348838 -
Flags: review?(kaze) → review+
Comment 25•11 years ago
|
||
(In reply to Gabriele Svelto [:gsvelto] from comment #21)
> (In reply to Fabien Cazenave [:kaze] from comment #20)
> > Naive and unrelated question: why do you submit a text patch *and* a github
> > PR? Wouldn’t the latter be enough?
>
> Yeah but I prefer to have the patch for review so all the review comments
> are on Bugzilla instead of Github (as well as the final patch) and then use
> the PR for Travis.
I see. On the other hand, addressing comments with successive commits on a single PR makes it much easier to review, especially for big patches (assuming that all commits are properly squashed before being merged).
I’ll start a discussion about that on m.d.gaia.
Assignee | ||
Comment 26•11 years ago
|
||
(In reply to Fabien Cazenave [:kaze] from comment #24)
> ::: apps/settings/js/do_not_track.js
> @@ +67,3 @@
> >
> > var lock = settings.createLock();
> > + var cset = { 'privacy.donottrackheader.enabled': enabled };
>
> Nitpick, in such cases we often use that:
>
> var cset = {};
> cset[kEnabledKey] = enabled;
Thanks! Here's a final patch with this bit addressed, I'm carrying over the review flag. I'll wait for Travis to turn green and then land on master / v1.2 and v1.3. It applies cleanly on all branches fortunately.
Attachment #8348838 -
Attachment is obsolete: true
Assignee | ||
Comment 27•11 years ago
|
||
Pushed to:
master 6df05c061f9815384ae9b1c8465e1e570c08c7af
v1.2 c82c957e9d4078cd4043de6b7d21a2667a73adf7
v1.3 50d3c9e24e4b7f218ea5d1aa93f7005240acac2c
Updated•10 years ago
|
Flags: needinfo?(arthur.chen)
You need to log in
before you can comment on or make changes to this bug.
Description
•