[tbb-commits] [Git][tpo/applications/tor-browser][tor-browser-115.5.0esr-13.5-1] fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in...

Pier Angelo Vendrame (@pierov) git at gitlab.torproject.org
Thu Nov 30 08:44:05 UTC 2023



Pier Angelo Vendrame pushed to branch tor-browser-115.5.0esr-13.5-1 at The Tor Project / Applications / Tor Browser


Commits:
75ee8a08 by Pier Angelo Vendrame at 2023-11-28T17:06:52+01:00
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection

Bug 42299: Unbreak about:preferences#connection when invalid bridge
lines are supplied

We switched to a shared bridge line parser. It might throw if an invalid
bridge line is passed, but we do not handle the exception in
connectionPane.js. As a result, the page breaks.

As a workaround, we can simply ignore the errors, but a better solution
would warn the user about that.
A bridge card rework is expected to happen in the 13.5 cycle, so I think
we can defer a proper fix to that moment.
(This should also be the UX of 11.5, 12.0 and 12.5).

- - - - -


1 changed file:

- browser/components/torpreferences/content/connectionPane.js


Changes:

=====================================
browser/components/torpreferences/content/connectionPane.js
=====================================
@@ -398,7 +398,7 @@ const gConnectionPane = (function () {
       bridgeSwitch.addEventListener("toggle", () => {
         TorSettings.bridges.enabled = bridgeSwitch.pressed;
         TorSettings.saveToPrefs();
-        TorSettings.applySettings().then(result => {
+        TorSettings.applySettings().finally(() => {
           this._populateBridgeCards();
         });
       });
@@ -486,7 +486,12 @@ const gConnectionPane = (function () {
         });
         const idString = TorStrings.settings.bridgeId;
         const id = card.querySelector(selectors.bridges.cardId);
-        const details = TorParsers.parseBridgeLine(bridgeString);
+        let details;
+        try {
+          details = TorParsers.parseBridgeLine(bridgeString);
+        } catch (e) {
+          console.error(`Detected invalid bridge line: ${bridgeString}`, e);
+        }
         if (details && details.id !== undefined) {
           card.setAttribute("data-bridge-id", details.id);
         }
@@ -529,7 +534,7 @@ const gConnectionPane = (function () {
                 bridgeSwitch.pressed && !!strings.length;
               TorSettings.bridges.bridge_strings = strings.join("\n");
               TorSettings.saveToPrefs();
-              TorSettings.applySettings().then(result => {
+              TorSettings.applySettings().finally(() => {
                 this._populateBridgeCards();
               });
             });
@@ -1021,7 +1026,7 @@ const gConnectionPane = (function () {
         TorSettings.bridges.builtin_type = "";
       }
       TorSettings.saveToPrefs();
-      TorSettings.applySettings().then(result => {
+      TorSettings.applySettings().finally(() => {
         this._populateBridgeCards();
       });
     },
@@ -1036,8 +1041,12 @@ const gConnectionPane = (function () {
     async saveBridgeSettings(connect) {
       TorSettings.saveToPrefs();
       // FIXME: This can throw if the user adds a bridge manually with invalid
-      // content. Should be addressed by tor-browser#40552.
-      await TorSettings.applySettings();
+      // content. Should be addressed by tor-browser#41913.
+      try {
+        await TorSettings.applySettings();
+      } catch (e) {
+        console.error("Applying settings failed", e);
+      }
 
       this._populateBridgeCards();
 



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/75ee8a08d5be379ac5e91c0a35005759f973bf83

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/75ee8a08d5be379ac5e91c0a35005759f973bf83
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20231130/b35337cf/attachment-0001.htm>


More information about the tbb-commits mailing list