Closed Bug 446536 Opened 16 years ago Closed 16 years ago

Save proxy settings for SSL, FTP, Gopher, SOCKS

Categories

(Toolkit :: Preferences, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.9.1b1

People

(Reporter: deepfire, Assigned: dev-null)

References

Details

(Keywords: regression, verified1.9.0.4)

Attachments

(3 files, 1 obsolete file)

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.
Can you check about:config after you save the changes?
Blocks: 448634
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.
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.
Status: UNCONFIRMED → NEW
Ever confirmed: true
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?
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.
as stated in bug 452024 this affects Fx trunk & Tb trunk, works in Fx 2 branch though.
Keywords: regression
Product: Firefox → Toolkit
QA Contact: preferences → preferences
Version: unspecified → Trunk
benc@meer.net >>...It probably says they are "user set",...
In about:config it says "user set" with bold font
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.
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. 
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.
Blocks: 410562
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...
(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.
Flags: wanted1.9.0.x?
Flags: blocking1.9.0.3?
Attachment #336618 - Flags: review?(gavin.sharp)
Comment on attachment 336618 [details] [diff] [review]
Patch v1.0
[Checkin: Comment 22]

This patch works fine for me.
Attachment #336618 - Flags: review?(gavin.sharp) → review+
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?
Assignee: nobody → dev-null
Flags: in-testsuite?
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → mozilla1.9.1b1
Attached patch Adds tests (obsolete) — Splinter Review
Attachment #337393 - Flags: review?(gavin.sharp)
Attachment #337393 - Attachment is obsolete: true
Attachment #337393 - Flags: review?(gavin.sharp)
Comment on attachment 337393 [details] [diff] [review]
Adds tests

now working on better test
Attachment #337797 - Flags: review?(gavin.sharp)
Can you point me to some more info on this pref? I googled and mozillazined, but didn't find any useful info.
(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 on attachment 337797 [details] [diff] [review]
Adds tests v2.0
[Checkin: Comment 23]

thanks, these are great!
Attachment #337797 - Flags: review?(gavin.sharp) → review+
Keywords: checkin-needed
Comment on attachment 336618 [details] [diff] [review]
Patch v1.0
[Checkin: Comment 22]

http://hg.mozilla.org/mozilla-central/rev/b338a9635ad6
Attachment #336618 - Attachment description: Patch v1.0 → Patch v1.0 [Checkin: Comment 22]
Comment on attachment 337797 [details] [diff] [review]
Adds tests v2.0
[Checkin: Comment 23]

http://hg.mozilla.org/mozilla-central/rev/baba4c0a6885
Attachment #337797 - Attachment description: Adds tests v2.0 → Adds tests v2.0 [Checkin: Comment 23]
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite? → in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
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.
Attachment #336618 - Flags: approval1.9.0.4?
Requesting approval for 1.9.0.4.

Supersedes review because just synced with 1.9branch.
Attachment #340535 - Flags: review+
Attachment #340535 - Flags: approval1.9.0.4?
Flags: wanted1.9.0.x?
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.4?
Comment on attachment 336618 [details] [diff] [review]
Patch v1.0
[Checkin: Comment 22]

Approved for 1.9.0.4, a=dveditz for release-drivers
Attachment #336618 - Flags: approval1.9.0.4? → approval1.9.0.4+
Attachment #340535 - Flags: approval1.9.0.4? → approval1.9.0.4+
Keywords: checkin-needed
Whiteboard: [checkin-needed on CVS trunk]
checked-in to 1.9.0 branch, thank you.
Whiteboard: [checkin-needed on CVS trunk]
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.
Summary: Don't save proxy settings for SSL, FTP, Gopher, SOCKS. → Save proxy settings for SSL, FTP, Gopher, SOCKS
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: