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

fix(jetbrains): avoid connection loops #12232

Merged
merged 1 commit into from
Sep 2, 2022
Merged

Conversation

andreafalzetti
Copy link
Contributor

@andreafalzetti andreafalzetti commented Aug 19, 2022

Description

Adds a check to make sure to avoid connecting multiple times to the same workspace. Not having this check in place is causing a loop of connections when trying to open a connection with a workspace that is already opened in another client.

The approach used is to show this message popup while we wait for a new API to request focus to the open IDE.

Screenshot 2022-09-01 at 23 37 26

Related Issue(s)

Fixes #9848

How to test

  1. Ensure you have the latest JetBrains Gateway installed.
  2. Download the plugin build related to this branch in Dev Versions, and install it on the Gateway.
  3. Start a workspace in gitpod.io with any JetBrains IDE as your preferred editor
  4. Open the IDE as you normally do
  5. Try launching new sessions by clicking on the "Open in IntelliJ" (or GoLand, etc)

Optionally,

  1. Open DevTools on the workspace browser page where you have the open in intellij button
  2. Simulate quick clicks on the button:
document.querySelectorAll('button')[1].click();
document.querySelectorAll('button')[1].click();
document.querySelectorAll('button')[1].click();
  1. Observe how 3 popups open but the main client does not stop or if affected.

Release Notes

Fixed JetBrains connection loop when connecting twice to the same workspace 

Documentation

Werft options:

  • /werft with-preview

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-fix-jb-connections-loop-9848.1 because the annotations in the pull request description changed
(with .werft/ from main)

@andreafalzetti andreafalzetti force-pushed the fix/jb-connections-loop-9848 branch 3 times, most recently from 0160863 to 39eb65e Compare August 29, 2022 22:49
@roboquat roboquat added size/M and removed size/S labels Aug 29, 2022
@andreafalzetti andreafalzetti force-pushed the fix/jb-connections-loop-9848 branch 3 times, most recently from 3a9b57d to fa8f597 Compare August 29, 2022 22:52
@roboquat roboquat added size/S and removed size/M labels Aug 29, 2022
@andreafalzetti andreafalzetti force-pushed the fix/jb-connections-loop-9848 branch 2 times, most recently from 35c718f to 859fdac Compare August 29, 2022 22:53
@andreafalzetti andreafalzetti force-pushed the fix/jb-connections-loop-9848 branch from 859fdac to e57420c Compare August 30, 2022 11:06
@roboquat roboquat added size/M and removed size/S labels Aug 30, 2022
@andreafalzetti andreafalzetti force-pushed the fix/jb-connections-loop-9848 branch 2 times, most recently from bd10ff0 to 0b3d189 Compare August 30, 2022 14:04
@andreafalzetti
Copy link
Contributor Author

andreafalzetti commented Aug 30, 2022

/werft run with-clean-slate-deployment

👍 started the job as gitpod-build-fix-jb-connections-loop-9848.13
(with .werft/ from main)

@andreafalzetti andreafalzetti force-pushed the fix/jb-connections-loop-9848 branch from 0b3d189 to 9b285ed Compare August 30, 2022 15:13
@roboquat roboquat removed the size/M label Aug 30, 2022
@andreafalzetti andreafalzetti force-pushed the fix/jb-connections-loop-9848 branch from c7321a6 to 0e7c17c Compare August 31, 2022 21:34
@andreafalzetti andreafalzetti marked this pull request as ready for review August 31, 2022 21:36
@andreafalzetti andreafalzetti requested a review from a team August 31, 2022 21:36
@andreafalzetti andreafalzetti force-pushed the fix/jb-connections-loop-9848 branch from 0e7c17c to ddeed4a Compare September 1, 2022 09:32
@roboquat roboquat added size/M and removed size/S labels Sep 1, 2022
@andreafalzetti andreafalzetti force-pushed the fix/jb-connections-loop-9848 branch from ddeed4a to 60f0428 Compare September 1, 2022 10:29
@andreafalzetti
Copy link
Contributor Author

andreafalzetti commented Sep 1, 2022

/werft run with-clean-slate-deployment

👍 started the job as gitpod-build-fix-jb-connections-loop-9848.22
(with .werft/ from main)

@andreafalzetti
Copy link
Contributor Author

andreafalzetti commented Sep 1, 2022

/werft run with-clean-slate-deployment with-large-vm

👍 started the job as gitpod-build-fix-jb-connections-loop-9848.23
(with .werft/ from main)

@andreafalzetti andreafalzetti marked this pull request as draft September 1, 2022 21:18
@andreafalzetti andreafalzetti changed the title fix(jetbrains): avoid connection loops fix(jetbrains): avoid connection loops [BROKEN PREV ENV] Sep 1, 2022
@andreafalzetti andreafalzetti changed the title fix(jetbrains): avoid connection loops [BROKEN PREV ENV] fix(jetbrains): avoid connection loops Sep 1, 2022
@andreafalzetti andreafalzetti marked this pull request as ready for review September 1, 2022 22:44
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-wise it looks great

/hold

@felladrin Could you help with testing please? 🙏

Copy link
Contributor

@felladrin felladrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reviewed and tested! ✅

Detection was really fast! Worked for all cases I tested.

image

@andreafalzetti
Copy link
Contributor Author

andreafalzetti commented Sep 2, 2022

thanks folks 🙏

/unhold

@roboquat roboquat merged commit 659d832 into main Sep 2, 2022
@roboquat roboquat deleted the fix/jb-connections-loop-9848 branch September 2, 2022 16:39
@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed Change is completely running in production editor: jetbrains release-note size/M team: IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refresh workspace page or revisit it and you end up in jetbrains spawning hell
4 participants