Last Comment Bug 446536 - Save proxy settings for SSL, FTP, Gopher, SOCKS
: Save proxy settings for SSL, FTP, Gopher, SOCKS
Status: RESOLVED FIXED
: regression, verified1.9.0.4
Product: Toolkit
Classification: Components
Component: Preferences (show other bugs)
: Trunk
: All All
: -- major (vote)
: mozilla1.9.1b1
Assigned To: Atsushi Sakai
:
Mentors:
: 452024 (view as bug list)
Depends on:
Blocks: 410562 448634
  Show dependency treegraph
 
Reported: 2008-07-21 22:44 PDT by Deep Fire
Modified: 2008-11-05 09:22 PST (History)
10 users (show)
dveditz: wanted1.9.0.x+
bugzillamozillaorg_serge_20140323: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1.0 [Checkin: Comment 22] (1.46 KB, patch)
2008-09-02 23:40 PDT, Atsushi Sakai
gavin.sharp: review+
dveditz: approval1.9.0.4+
Details | Diff | Splinter Review
Adds tests (5.59 KB, patch)
2008-09-07 21:56 PDT, Atsushi Sakai
no flags Details | Diff | Splinter Review
Adds tests v2.0 [Checkin: Comment 23] (11.86 KB, patch)
2008-09-09 19:13 PDT, Atsushi Sakai
gavin.sharp: review+
Details | Diff | Splinter Review
Adds tests v2.0 for 1.9branch (12.56 KB, patch)
2008-09-26 02:48 PDT, Atsushi Sakai
dev-null: review+
dveditz: approval1.9.0.4+
Details | Diff | Splinter Review

Description Deep Fire 2008-07-21 22:44:19 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9) Gecko/2008052906 Firefox/3.0

When you try to use separate proxy settings for different protocols, after pressing OK, they wont work. I returned to recheck settings, and they are all blank, with port 0 next to each. Only first proxy HTTP might be set properly.

Reproducible: Always

Steps to Reproduce:
1.none, happens every time. Checked on 2 different PCs. The same.
2.
3.
Comment 1 benc 2008-08-19 21:04:05 PDT
Can you check about:config after you save the changes?
Comment 2 Deep Fire 2008-08-21 01:15:09 PDT
Entered 192.168.7.91 , port 21 for FTP. After OK-OK, about:config is updated (at least showing rigth settings). Close browser.

Starting again - trying to load anything using my settings - fail.

Going to the UI - field is void. Checking about:config proxy setting also voided.
Comment 3 benc 2008-08-21 23:37:51 PDT
Okay. Please go into your profile's prefs directory, and see what files are there, and look for lines in any file that say:

"network.proxy."

If you are familiar with DOS, I *think*:

find "network.proxy." * 

My current guess is there is something lying around in there.
Comment 4 Deep Fire 2008-08-23 03:30:42 PDT
The sole file containing "network.proxy." location:
D:\Documents and Settings\DeepFire\Application Data\Mozilla\Firefox\Profiles\fg7nfhlv.default\prefs.js

I set proxy, there is an update
//**********************
user_pref("network.proxy.backup.ftp", "");
user_pref("network.proxy.backup.ftp_port", 0);
user_pref("network.proxy.backup.gopher", "");
user_pref("network.proxy.backup.gopher_port", 0);
user_pref("network.proxy.backup.socks", "");
user_pref("network.proxy.backup.socks_port", 0);
user_pref("network.proxy.backup.ssl", "");
user_pref("network.proxy.backup.ssl_port", 0);
////***** these 2 lines appears
user_pref("network.proxy.ftp", "127.0.0.1");
user_pref("network.proxy.ftp_port", 21);
////***** these 2 lines appears
user_pref("network.proxy.http", "127.0.0.1");
user_pref("network.proxy.http_port", 3129);
user_pref("network.proxy.type", 1);
//**********************

AFTER:

//**********************
user_pref("network.proxy.backup.ftp", "");
user_pref("network.proxy.backup.ftp_port", 0);
user_pref("network.proxy.backup.gopher", "");
user_pref("network.proxy.backup.gopher_port", 0);
user_pref("network.proxy.backup.socks", "");
user_pref("network.proxy.backup.socks_port", 0);
user_pref("network.proxy.backup.ssl", "");
user_pref("network.proxy.backup.ssl_port", 0);
user_pref("network.proxy.http", "127.0.0.1");
user_pref("network.proxy.http_port", 3129);
user_pref("network.proxy.type", 1);
//**********************

Besides, I notices that, when file is updated 1st time, lines concerning my custom proxy settings are still there, even when I open UI and it shows me void textboxes, but when I press OK with void fields, they disappears from prefs.js as well. 
Looks like there is a trouble with populating fields from prefs.js while reading the file, maybe?
Comment 5 benc 2008-08-24 23:31:10 PDT
Okay: I *think* found the problem... I'm not sure why it doesn't happen to everyone, maybe they push the buttons in a different order, and they get a different prefs block...

120                 <textbox id="networkProxyHTTP" flex="1"
121                          preference="network.proxy.http" onsyncfrompreference="return gConnectionsDialog.readHTTPProxyServer();"/>

123                 <textbox id="networkProxyHTTP_Port" type="number" max="65535" size="5"
124                          preference="network.proxy.http_port" onsyncfrompreference="return gConnectionsDialog.readHTTPProxyPort();"/>

Both these functions are called as the preferences are read, and they both include:

200       this.updateProtocolPrefs();

208       this.updateProtocolPrefs();


142       // Restore previous per-proxy custom settings, if present. 
143       if (!shareProxiesPref.value) {
144         var backupServerURLPref = document.getElementById("network.proxy.backup." + proxyPrefs[i]);
145         var backupPortPref = document.getElementById("network.proxy.backup." + proxyPrefs[i] + "_port");
146         if (backupServerURLPref.hasUserValue) {
147           proxyServerURLPref.value = backupServerURLPref.value;
148           backupServerURLPref.reset();
149         }
150         if (backupPortPref.hasUserValue) {
151           proxyPortPref.value = backupPortPref.value;
152           backupPortPref.reset();

So the question is, what do your network.proxy.backup.* say in about:config? It probably says they are "user set", because they are saved to disk (as your second search shows).

But on my Mac, they don't. Then again, most bugs that sound like this are in windows.
Comment 6 XtC4UaLL [:xtc4uall] 2008-08-24 23:43:05 PDT
*** Bug 452024 has been marked as a duplicate of this bug. ***
Comment 7 XtC4UaLL [:xtc4uall] 2008-08-24 23:50:01 PDT
as stated in bug 452024 this affects Fx trunk & Tb trunk, works in Fx 2 branch though.
Comment 8 Deep Fire 2008-08-25 05:51:54 PDT
benc@meer.net >>...It probably says they are "user set",...
In about:config it says "user set" with bold font
Comment 9 Deep Fire 2008-08-25 05:58:40 PDT
Today bug was again tested with fresh install of Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9) Gecko/2008052906 Firefox/3.0 on nearly-virgin system (in case that it caused by some soft, that heavily modify registry). 

Nope, the bug is still there, he he.
Comment 10 benc 2008-08-25 15:38:57 PDT
We need to bring in some heavy prefs knowledge here. I wrote the "Brief Guide", so that makes me, by definition, a lightweight...

The only think I can think of to check, is to check the applications's prefs files (greprefs/ and default/pref/)... by grepping for network.proxy.backup in these directories. 
Comment 11 Atsushi Sakai 2008-09-02 23:40:53 PDT
Created attachment 336618 [details] [diff] [review]
Patch v1.0
[Checkin: Comment 22]

Proposed patch, but not yet tested enough.

Bug 410562 caused this.
Two problems here:
* In _setValue(), if value is null, value can't be set to undefined
  because |null != undefined| is false.
  null and undefined should be distinguished.
* If a preference is marked as defer reset, hasUserValue should be false
  as UI shows default value, not user value.
Comment 12 benc 2008-09-03 17:57:03 PDT
ah, is this why this is only on Windows?

If we are going to fix this, can we also fix the behavior where in some cases, if you click the checkbox on and off two or three times, the backup values are erased? I was working on analyzing that when I dug up the problem report in this bug. I'll try to file a bug tonight...
Comment 13 Atsushi Sakai 2008-09-04 06:59:52 PDT
(In reply to comment #12)
> ah, is this why this is only on Windows?

This behavior depends on browser.preferences.instantApply.
It's false by default on Windows, but it's true on the other OSs.

Steps to reproduce for all OSs:
1. Change browser.preferences.instantApply to false. (It's default on Windows)
2. Open Tools -> Options (or Prefences) -> Advanced -> Network -> Settings.
3. Select Manual proxy configuration.
4. Enable Use this proxy server for all protocols.
5. Click OK in Connection Settings.
6. Click OK in Options (or Preferences).
7. Open Tools -> Options (or Preferences) -> Advanced -> Network -> Settings.
8. Disable Use this proxy server for all protocols.
9. Enter some settings into SSL/FTP/Gopher/SOCKS.
10. Click OK in Connection Settings.
11. Click OK in Options (or Preferences).
12. Open Tools -> Options (or Preferences) -> Advanced -> Network -> Settings.

Actual result: Settings disappears.

Expected result: Settings appears.

> if you click the checkbox on and off two or three times, the backup values are
> erased?

It should be fixed by Patch v1.0.
Comment 14 Atsushi Sakai 2008-09-07 06:57:29 PDT
Comment on attachment 336618 [details] [diff] [review]
Patch v1.0
[Checkin: Comment 22]

This patch works fine for me.
Comment 15 :Gavin Sharp [email: gavin@gavinsharp.com] 2008-09-07 10:33:08 PDT
Comment on attachment 336618 [details] [diff] [review]
Patch v1.0
[Checkin: Comment 22]

Could you add tests for both of these issues to toolkit/content/tests/chrome/test_preferences.xul , please?
Comment 16 Atsushi Sakai 2008-09-07 21:56:07 PDT
Created attachment 337393 [details] [diff] [review]
Adds tests
Comment 17 Atsushi Sakai 2008-09-09 02:49:16 PDT
Comment on attachment 337393 [details] [diff] [review]
Adds tests

now working on better test
Comment 18 Atsushi Sakai 2008-09-09 19:13:53 PDT
Created attachment 337797 [details] [diff] [review]
Adds tests v2.0
[Checkin: Comment 23]
Comment 19 benc 2008-09-12 08:50:57 PDT
Can you point me to some more info on this pref? I googled and mozillazined, but didn't find any useful info.
Comment 20 Atsushi Sakai 2008-09-13 06:46:56 PDT
(In reply to comment #19)
> Can you point me to some more info on this pref?

What does "this pref" mean?
"network.proxy.backup.*" ?
Comment 21 :Gavin Sharp [email: gavin@gavinsharp.com] 2008-09-15 07:51:13 PDT
Comment on attachment 337797 [details] [diff] [review]
Adds tests v2.0
[Checkin: Comment 23]

thanks, these are great!
Comment 22 Serge Gautherie (:sgautherie) 2008-09-17 06:10:54 PDT
Comment on attachment 336618 [details] [diff] [review]
Patch v1.0
[Checkin: Comment 22]

http://hg.mozilla.org/mozilla-central/rev/b338a9635ad6
Comment 23 Serge Gautherie (:sgautherie) 2008-09-17 06:13:09 PDT
Comment on attachment 337797 [details] [diff] [review]
Adds tests v2.0
[Checkin: Comment 23]

http://hg.mozilla.org/mozilla-central/rev/baba4c0a6885
Comment 24 Atsushi Sakai 2008-09-26 02:44:34 PDT
Comment on attachment 336618 [details] [diff] [review]
Patch v1.0
[Checkin: Comment 22]

requesting approval for 1.9.0.4

"fix" part can be applied to 1.9branch cleanly.
Comment 25 Atsushi Sakai 2008-09-26 02:48:33 PDT
Created attachment 340535 [details] [diff] [review]
Adds tests v2.0 for 1.9branch

Requesting approval for 1.9.0.4.

Supersedes review because just synced with 1.9branch.
Comment 26 Daniel Veditz [:dveditz] 2008-10-06 11:24:37 PDT
Comment on attachment 336618 [details] [diff] [review]
Patch v1.0
[Checkin: Comment 22]

Approved for 1.9.0.4, a=dveditz for release-drivers
Comment 27 Masayuki Nakano [:masayuki] (Mozilla Japan) 2008-10-11 06:36:23 PDT
checked-in to 1.9.0 branch, thank you.
Comment 28 Al Billings [:abillings] 2008-10-23 16:57:37 PDT
Verified for 1.9.0.4 with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4pre) Gecko/2008102306 GranParadiso/3.0.4pre. Settings now persist.

Note You need to log in before you can comment on or make changes to this bug.