Restart FX will automatically recheck "notify me when a new study comes"

RESOLVED FIXED in 1.3

Status

Mozilla Labs Graveyard
Test Pilot
P1
critical
RESOLVED FIXED
8 years ago
2 years ago

People

(Reporter: Jinghua zhang, Assigned: Jono Xia)

Tracking

unspecified
x86
Mac OS X
Bug Flags:
in-testsuite -
in-litmus ?

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

8 years ago
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:2.0b1) Gecko/20100630 Firefox/4.0b1

Reproduce:
1. uncheck "notify me when a new study comes" in TP panel
2. restart Firefox

Actually result:
"notify me when a new study comes" is checked.

Expect result:
"notify me when a new study comes" is unchecked.
(Reporter)

Updated

8 years ago
Severity: normal → critical
Flags: in-testsuite?
Flags: in-litmus?
Priority: -- → P1
Target Milestone: -- → 0.3
(Reporter)

Updated

8 years ago
Target Milestone: 0.3 → 1.3
(Assignee)

Comment 1

8 years ago
Oh dear.  I thought that I was doing this the right way (setting the pref in the default branch, so that it is overridden by any user-created settings) but it looks like I was wrong.
(Assignee)

Comment 2

8 years ago
Andres says:

> The problem is that the preferences are not being saved, since the browser.preferences.instantApply is set to false by default on Fx, so changes to the test pilot settings are not being applied immediately. According to https://developer.mozilla.org/en/XUL/prefwindow, in this case a OK value is needed when closing in order to save the preferences. But as we don't have buttons in this window, the only way to close the TP panel is with the window close button, which don't save the preferences.

So if that's the case, then it's not just changes to the "notify me when a new study comes" pref that's not being saved -- it's all the prefs in the Test Pilot pref pane!!

I would favor saving the prefs in the unload method of the window, or if that doesn't work, adding click handlers to the buttons in the pref pane to save the changes immediately.  I'd prefer not to have to add any buttons or change the value of browser.preferences.instantApply.
Created attachment 462836 [details] [diff] [review]
proposed patch

Saving preferences in the unload window event.
(Assignee)

Comment 4

8 years ago
The patch doesn't seem to be working for me on Windows -- even if I just close the all-studies window and then reopen it (without quitting Firefox), my prefs revert to what they were before.

The code looks right, though, so let me play around with it a little more.  Maybe I can figure out what's going on.
Hmm,  ok, we could write a general test case that checks that "state" of TP prefs remains the same on restart. Not going to write a case for each specific pref though. Are restart test cases difficult in automated test suites? I think so.  minusing that.
Flags: in-testsuite? → in-testsuite-
Attachment #462836 - Flags: review?(dtownsend)
Comment on attachment 462836 [details] [diff] [review]
proposed patch

You're breaking the platform consistency by doing this, not sure if I agree with that but I guess that is your call to make.

This code is not very maintainable, you would need to remember to update the JS every time you modify the set of preferences. Instead just do:

document.getElementById("settings-pane").writePreferences(true);
Attachment #462836 - Flags: review?(dtownsend) → review-
(Assignee)

Comment 7

7 years ago
Created attachment 470055 [details] [diff] [review]
New patch using prefPane.writePreferences instead

Made a new patch using your suggestion.  Please reveiw this one instead.
Attachment #462836 - Attachment is obsolete: true
Attachment #470055 - Flags: review+
Landed in mozilla-central: http://hg.mozilla.org/mozilla-central/rev/bd3fb04d8e6d
Assignee: nobody → jdicarlo
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Product: Mozilla Labs → Mozilla Labs Graveyard
You need to log in before you can comment on or make changes to this bug.