gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

Only try to connect ws immediately when tab is activated

Open mustard-mh opened this issue 1 year ago • 4 comments

Description

  • [ ] hold to remove debug code

Related Issue(s)

Relates ENT-24

How to test

‼️ Test with Firefox

Regression

  • Workspace should work like before
  • Integration tests should pass

Firefox WS

  • Create a workspace in preview env with Firefox + VS Code Browser
  • Open workspace with 20 more tabs
  • Check if the tab you're working works well
  • Wait for x minutes, and click other tabs, they should be activated after tab is activated

Feature Flag Feature is controlled by ff websocket_url_provider_returns_immediately. Smoke test if workspace is working (need refresh web)

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • [ ] /werft with-werft Run the build with werft instead of GHA
  • [ ] leeway-no-cache
  • [ ] /werft no-test Run Leeway with --dont-test
Publish
  • [ ] /werft publish-to-npm
  • [ ] /werft publish-to-jb-marketplace
Installer
  • [x] analytics=log
  • [ ] with-dedicated-emulation
  • [ ] workspace-feature-flags Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • [ ] /werft with-local-preview If enabled this will build install/preview
  • [x] /werft with-preview
  • [x] /werft with-large-vm
  • [x] /werft with-gce-vm If enabled this will create the environment on GCE infra
  • [x] /werft preemptible Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • [x] with-integration-tests=all Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • [ ] with-monitoring

/hold

mustard-mh avatar Jun 24 '24 08:06 mustard-mh

it looks complicated, why do we do it?

akosyakov avatar Jun 26 '24 07:06 akosyakov

it looks complicated, why do we do it?

@akosyakov Firefox will block websocket if there're too many tabs opened, you could get more context from ENT-24 and [internal chat]

mustard-mh avatar Jun 26 '24 07:06 mustard-mh

Is there a way we auto close tabs of old workspaces or something like that, I afraid that we will break something with all smartness around events.

I remember we would show a notification to the user from the dashboard that failed to establish the websocket maybe you have so many tabs. But it was disabled for IDE, maybe we enable it in the dashboard always in case of FF.

akosyakov avatar Jun 26 '24 07:06 akosyakov

Is there a way we auto close tabs of old workspaces or something like that, I afraid that we will break something with all smartness around events. I remember we would show a notification to the user from the dashboard that failed to establish the websocket maybe you have so many tabs. But it was disabled for IDE, maybe we enable it in the dashboard always in case of FF.

They way I understand your comment is:

  • if a tab is in background for long enough, we stop re-connecting websocket, and show a "Old tab, want to reconnect? Ok" modal
  • if users come back, they have to manually click that button, which:
    • makes them aware something might be off
    • we do a soft-reload in the background, mitigating any potential "state-out-of-sync" issues

@akosyakov Is that what you mean? :thinking:

geropl avatar Jun 26 '24 09:06 geropl

Canceled, let's re-open if needed in the future

mustard-mh avatar Jul 08 '24 18:07 mustard-mh