Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tor connection timeout is too short #24978

Closed
fmarier opened this issue Aug 25, 2022 · 11 comments · Fixed by brave/brave-core#15505
Closed

Tor connection timeout is too short #24978

fmarier opened this issue Aug 25, 2022 · 11 comments · Fixed by brave/brave-core#15505

Comments

@fmarier
Copy link
Member

fmarier commented Aug 25, 2022

When opening a Tor window, the tor daemon needs to start up and connect to the Tor network. While it's doing that, we should a notification:
tor-connecting

Once it's done, we change to a successful notification:
Screenshot from 2022-08-25 11-24-34

In cases of failure, we show an error:
tor-error

The problem is that the error notification is shown unconditionally after a 30-sec timeout. Sometimes it takes longer than 30s for a connection to be established and in that case, we show the error notification and then a few seconds later, it gets replaced with a success notification, which is pretty confusing.

@fmarier
Copy link
Member Author

fmarier commented Aug 25, 2022

The proposed solution (thanks to @rmcfadden3 and @aguscruiz) is to add a second timer:

  1. "Tor is connecting…" (no change)
  2. [30 seconds pass]
  3. "Still connecting (there's some slowness in the Tor network)" (new string, same background color as the "Tor is connecting" message)
  4. [30 seconds pass]
  5. "Tor connection failed" / "Tor connected successful" (no change)

@fmarier
Copy link
Member Author

fmarier commented Aug 25, 2022

cc @boocmp

@MadhaviSeelam
Copy link

Verification In progress using

Brave | 1.47.126 Chromium: 108.0.5359.99 (Official Build) beta (64-bit)
-- | --
Revision | 410951fc34bb4b2cbf182231f9f779efaafaf682-refs/branch-heads/5359_71@{#9}
OS | Windows 11 Version 21H2 (Build 22000.1335)
  1. Install 1.47.126
  2. launch Brave
  3. open brave://settings/privacy in a new-tab
  4. enable Use Bridges in Tor windows section
  5. select meek-azure in Select a built-in-bridge drop-down menu
  6. click Apply changes
  7. click hamburger menu >> New private window with Tor
step 4 step 5 initial tor connection still connecting Tor failed
image image image image image

@MadhaviSeelam
Copy link

@boocmp any update on above issue as error message shown for each status takes > 2 minutes
cc: @fmarier

https://bravesoftware.slack.com/archives/C85NV6NSG/p1671045026328789

@LaurenWags
Copy link
Member

cc @rebron on #24978 (comment)

@LaurenWags
Copy link
Member

Removing QA/Blocked per today's desktop planning meeting. cc-ing @GeetaSarvadnya @btlechowski @kjozwiak to check this issue.

We decided to confirm that the expected messages display and @MadhaviSeelam will log a follow up issue for the timing if it is still problematic.

cc @rebron

@btlechowski
Copy link

btlechowski commented Jan 11, 2023

Verification passed on

Brave 1.47.169 Chromium: 109.0.5414.87 (Official Build) (64-bit)
Revision 2dc18eb511c56e012081b4abc9e38c81c885f7d4-refs/branch-heads/5414@{#1241}
OS Ubuntu 18.04 LTS

Verified Tor connection indicator works properly when connection is successful

Connecting:
image

Connected:
image

Verified Tor connection indicator works properly when connection has problems

Note used STR from #24978 (comment)

Connecting:
image

Connection takes longer than expected
image

Connection failed
image

Time between states was >2minutes

Logged Tor connection indicator flashes red just before successfully connecting to Tor #27746
Logged Some string are not translated in Tor connection indicator #27747

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Jan 11, 2023

Verified on

Brave | 1.47.169 Chromium: 109.0.5414.87 (Official Build) (64-bit)
-- | --
Revision | 2dc18eb511c56e012081b4abc9e38c81c885f7d4-refs/branch-heads/5414@{#1241}
OS | Windows 10 Version 21H2 (Build 19044.2364)

  1. Install 1.47.169
  2. launch Brave
  3. open brave://settings/privacy in a new-tab
  4. enable Use Bridges in Tor windows section
  5. select meek-azure in Select a built-in-bridge drop-down menu
  6. click Apply changes
  7. click hamburger menu >> New private window with Tor

Once I open the Tor windows I am seeing the different messages as below:

  1. 1st message is Disconnected remains on the TOR windows around 2 to 3 seconds
  2. 2nd message Tor connection failed flashes and go off in a fraction of seconds
  3. 3rd message Tor is connecting remains on the TOR windows for around 9 mins 15 seconds
  4. 6th message Tor connection failed is shown after 9 mins 15 seconds
1st msg 2nd msg 3rd msg 4th msg 5th msg 6th msg
image image image image image image

@MadhaviSeelam
Copy link

MadhaviSeelam commented Jan 12, 2023

Verification PASSED using

Brave | 1.47.169 Chromium: 109.0.5414.87 (Official Build) (64-bit)
-- | --
Revision | 2dc18eb511c56e012081b4abc9e38c81c885f7d4-refs/branch-heads/5414@{#1241}
OS | Windows 11 Version 21H2 (Build 22000.1455)

Retested with 1.47.169

Tor is connecting... Still connecting... Tor connection failed
image image image

@stephendonner
Copy link

stephendonner commented Jan 12, 2023

Verification PASSED using

Brave 1.47.171 Chromium: 109.0.5414.87 (Official Build) (x86_64)
Revision 2dc18eb511c56e012081b4abc9e38c81c885f7d4-refs/branch-heads/5414@{#1241}
OS macOS Version 11.7.2 (Build 20G1020)
  1. installed 1.47.171
  2. launched Brave
  3. opened brave://settings/privacy in a new-tab
  4. enabled Use Bridges in Tor windows section
  5. selected meek-azure in Select a built-in-bridge drop-down menu
  6. clicked Apply changes
  7. clicked hamburger menu >> New private window with Tor

Once I opened the Tor windows I am seeing the different messages as below:

  1. 1st message is Disconnected remains on the TOR windows around 2 to 3 seconds
  2. 2nd message Tor connection failed flashes and go off in a fraction of seconds
  3. 3rd message Tor is connecting remains on the TOR windows for around 9 mins 15 seconds
  4. 6th message Tor connection failed is shown after 9 mins 15 seconds
1st msg 2nd msg 3rd msg 4th msg 5th msg 6th msg
Screen Shot 2023-01-12 at 10 31 49 AM Screen Shot 2023-01-12 at 10 39 16 AM Screen Shot 2023-01-12 at 10 32 41 AM Screen Shot 2023-01-12 at 10 41 17 AM Screen Shot 2023-01-12 at 10 38 30 AM Screen Shot 2023-01-12 at 10 39 16 AM

@boocmp
Copy link

boocmp commented Jan 16, 2023

The Meek-Azure bridge has begun to show signs of life, it is trying to create a connection and periodically sends a progress message (14% or 15% of Handshake with a relay done). We're resetting the connection timer at every progress message so this causes the messages "still connecting" and "Tor is connecting" to swap each other until the bridge stops trying to connect. We need to check 'count' field of the progress message to determine that is the same as we received early and ignore it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment