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

"Preferences" dialog shows proxy is configured as SOCKS after user configures HTTP proxy #1775

Closed
3 tasks done
per1234 opened this issue Dec 16, 2022 · 3 comments · Fixed by #1778
Closed
3 tasks done
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Dec 16, 2022

Describe the problem

Users may access the Internet via a proxy server. Arduino IDE can be configured for this use case via the "Network" tab of the "Preferences" dialog.

Two types of proxies are supported:

The proxy type is selected via a radio button on the dialog.

🐛 The radio button is set to "SOCKS" after the IDE is reloaded even though the user selected the "HTTP" radio button in the "Preferences" dialog when they configured the proxy preferences.

To reproduce

  1. Select File > Preferences... from the Arduino IDE menus.
  2. Click the "Network" tab.
  3. Select the "Manual proxy configuration" radio button.
  4. Configure proxy as follows:
    • Select the "HTTP" radio button.
    • Set "Host name" to example.com
    • Set "Port number" to 42
    • Set "Username" to foo
    • Set "Password" to bar
  5. Click the OK button.
    The index download process may now fail. This is expected due to the use of an dummy proxy configuration for the demo.
  6. Select File > Quit from the Arduino IDE menus.
  7. Start Arduino IDE.
  8. Select File > Preferences... from the Arduino IDE menus.
  9. Click the "Network" tab.

🐛 The radio button is set to "SOCKS":

image

Expected behavior

Proxy type radio button in the "Preferences" dialog always correctly reflects the proxy type that was configured.

Arduino IDE version

908ec4c

Operating system

Windows

Operating system version

10

Additional context

The "Preferences" dialog shows the correct "HTTP" radio button if the dialog is opened again after configuring the proxy but before restarting Arduino IDE. The fault only occurs after a restart.


The network.proxy key in ~/.arduinoIDE/arduino-cli.yaml does have the http URL scheme as expected even though the "Preferences" dialog indicates it is a SOCKS proxy (for which Arduino IDE currently uses the socks URL scheme):

network:
  proxy: http://foo:bar@example.com:42/

Originally reported by @wh201906 at #1769

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Dec 16, 2022
@wh201906
Copy link
Contributor

wh201906 commented Dec 17, 2022

This is what I found.
I put a breakpoint in renderProxySettings() and I found the this.state.network.protocol is http: rather than http
(I printed this.state.network in the console. You can find the protocol in the bottom of the image.)
图片
Since the SOCKS radiobutton loads after the HTTP radiobutton, it find http: doesn't match http, then set checked=true
I guess this is the reason?

@wh201906
Copy link
Contributor

If I click HTTP button in Preferences->Network, this.state.network is http rather than http:
图片

@wh201906
Copy link
Contributor

I think PR #1778 will fix this.

@kittaakos kittaakos added the conclusion: resolved Issue was resolved label Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants