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

spike: proxy error on login [INS-4009] #7546

Merged
merged 6 commits into from
Jun 17, 2024
Merged

Conversation

filfreire
Copy link
Member

@filfreire filfreire commented Jun 13, 2024

Closes, barely, INS-4009. hic sunt dracones

Some users will see the "Failed to Fetch" due to having a Proxy configured, either on their machines or on Insomnia Settings, which doesn't seem to work well with InsomniaFetch during login or the whoami call. One extra hypothesis, untested, is that some users might be facing problems due to CORS, not sure yet

I've tried capturing exception similar to ERR_PROXY_CONNECTION_FAILED but it gets swallowed by sentry instrumentation on fetch() function, regardless of what failure happens of fetch, it's swallowed with a TypeError: Failed to fetch.

By the time we try to capture a http status code, we always get the above exception.

image

Tried a handful of things to circunvent this but nothing seemed to work, e.g.

  • using beforeSend on sentry on sentry config
  • using ignoreErrors on sentry config
  • filtering out Http from integrations on sentry config

Other related findings:

Useful steps to repro/test

  • Set Proxy for http and https on insomnia settings with a value like localhost:8005 that will force the exception
  • If you want to avoid having to re-login on every code-edit, you can use the electron console instead, manually try to send fetch() by hand to whoami endpoint or a url that doesn't exist.
await fetch('https://api.insomnia.rest/whoami').catch(error => {console.log(error)})

image

@filfreire filfreire requested a review from a team June 13, 2024 14:42
@filfreire filfreire changed the title fix: proxy error on login [INS-4009] spike: proxy error on login [INS-4009] Jun 13, 2024
@jackkav
Copy link
Contributor

jackkav commented Jun 13, 2024

Is the preferences panel visible during login in order for a user to respond to your message? And is insomnia proxy config the cause of this error? Could it also be system proxy?

@filfreire
Copy link
Member Author

Is the preferences panel visible during login in order for a user to respond to your message? And is insomnia proxy config the cause of this error? Could it also be system proxy?

Preferences is visible by doing the keyboard shortcut - not good UX, perhaps a "link" that would open preferences would also help.

It can be either Insomnia proxy config and system proxy.

@jackkav
Copy link
Contributor

jackkav commented Jun 13, 2024

Perhaps indicate the hot key and generalise the wording to compensate

@filfreire
Copy link
Member Author

@jackkav added preferences button and changed the error text a bit:

image

@filfreire filfreire requested review from jackkav and a team June 14, 2024 14:26
@filfreire filfreire enabled auto-merge (squash) June 17, 2024 08:59
@filfreire filfreire disabled auto-merge June 17, 2024 11:47
@filfreire filfreire enabled auto-merge (squash) June 17, 2024 11:52
@filfreire filfreire merged commit fd8f12e into Kong:develop Jun 17, 2024
7 checks passed
@filfreire filfreire deleted the fix/INS-4009 branch June 17, 2024 12:04
stefancruz pushed a commit to stefancruz/insomnia that referenced this pull request Jun 30, 2024
* fix: proxy error on login [INS-4009]

* add preferences button

* change data-testid for settings in auth authorize

* Update packages/insomnia/src/ui/routes/auth.authorize.tsx

Co-authored-by: Jack Kavanagh <jackkav@gmail.com>

* Update auth.authorize.tsx

* Update auth.authorize.tsx

---------

Co-authored-by: Jack Kavanagh <jackkav@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants