When a user requests a bridge using one of the bridge distributors (moat, telegram, connection assist), some of them may be blocked in their region. Users can see which bridge is failing on their Tor logs. Is it possible to display that information on the bridge card so they don't need to check the logs?
donutschanged title from [Connection settings] Bridge card should inform which bridge is not working to Bridge cards should inform users when a bridge isn't working
changed title from [Connection settings] Bridge card should inform which bridge is not working to Bridge cards should inform users when a bridge isn't working
Trying to sneak this in as part of the development for #42036 (closed), which will require a similar flag for lox bridges. My hope is that we can generalize this feature for all bridges.
But please keep in mind that users might have old invalid strings and that some user might try to add bridge via about:config.
Also, we do some parsing when we show a card, so we're given the information about a line being invalid "for free", we could use it to display a warning, so it's related also to bridge cards.
@pierov I wonder if "Can't connect" (the new flag that's planned for lox, see the design at the top of the ticket) is sufficient enough to prompt users with invalid bridge lines to remove and re-add them.
My worry is that users won't understand what we mean by "invalid", or how to remedy the situation, and I'm not sure how else to describe the issue in 1-2 words.
@pierov in the current code, we always send the saved bridge lines to the tor process, regardless of whether parsing it within tor browser fails. Are there ever situations where our parser may fail, but they still "work" for the tor process? E.g. if one line is malformed, but another isn't, would it still be used?
If we know for sure that a failing parse will mean that the tor process will not (successfully) use the configuration, then we should perhaps just not send it.
Moreover, I'm assuming it is not possible to have failing bridge lines from a non-manual bridge source? Or rather, does failing bridge lines setting mean we can safely assume it is manual, even if it was set in "about:config" and the bridge "source" is different?
I think in this situation we could just not show the invalid bridge lines and instead have an info box similar to the custom security level box, with:
<p>Your manual bridge settings are broken.</p><button>Clear manual bridges</button><button>Edit bridges manually</button>
with the latter button opening the manual bridge dialog with the existing setting pre-filled and the error message coming from #41913.
@pierov in the current code, we always send the saved bridge lines to the tor process, regardless of whether parsing it within tor browser fails. Are there ever situations where our parser may fail, but they still "work" for the tor process? E.g. if one line is malformed, but another isn't, would it still be used?
Yes, bridge lines are separate configuration entries, even though they all have the same key.
So, I've tried to add a malformed line (garbage characters) followed by a snowflake line, and this was the log the tor process sent:
2023-12-05 09:42:58.737 [WARN] Too few items to Bridge line.2023-12-05 09:42:58.737 [WARN] Controller gave us config lines that didn't validate: Bridge line did not parse. See logs for details.2023-12-05 09:42:58.813 [NOTICE] Opening Socks listener on 127.0.0.1:91502023-12-05 09:42:58.814 [NOTICE] Opened Socks listener connection (ready) on 127.0.0.1:91502023-12-05 09:42:59.169 [NOTICE] Bootstrapped 1% (conn_pt): Connecting to pluggable transport2023-12-05 09:42:59.171 [NOTICE] Bootstrapped 2% (conn_done_pt): Connected to pluggable transport2023-12-05 09:42:59.179 [NOTICE] Bootstrapped 10% (conn_done): Connected to a relay2023-12-05 09:42:59.460 [NOTICE] Managed proxy "./TorBrowser/Tor/PluggableTransports/snowflake-client": offer created[...]
So, it continued with snowflake indeed.
Moreover, I'm assuming it is not possible to have failing bridge lines from a non-manual bridge source?
We save that we received bridge lines from BridgeDB for $reasons (not sure which ones, maybe for the old UI), but as a matter of fact, BridgeDB lines and manual lines are treated in the same way.
For the builtin bridges, their lines are stored as prefs, so it's possible for a user to go to about:config and change them, but probably we don't care of such a case.