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

[v16] Prevent activation of previous workspace when launching Connect via deep link to a different cluster #50733

Open
wants to merge 1 commit into
base: branch/v16
Choose a base branch
from

Conversation

gzdunek
Copy link
Contributor

@gzdunek gzdunek commented Jan 3, 2025

Backport #50063 to branch/v16

There were some minor conflicts in imports.

…eep link to a different cluster (#50063)

* Refactor `setActiveWorkspace` to async/await

* Keep all the logic that restores a single workspace state in `getWorkspaceDefaultState`

* Separate restoring state from setting active workspace

* Allow the dialog to reopen documents to be closed without any decision

* Add a test that verifies if the correct workspace is activated

* Docs improvements

* Return early if there's no restoredWorkspace

* Fix logger name

* Improve test name

* Make restored state immutable

* Fix comment

* Do not wait for functions to be called in tests

* Add tests for discarding documents reopen dialog

* Move setting `isInitialized` to a separate method

* Remove restored workspace when logging out so that we won't try to restore it when logging in again

* Do not try to restore previous documents if the user already opened new ones

* Do not close dialog in test

* Improve `isInitialized` comment

* Call `setActiveWorkspace` again when we fail to change the workspace

* Fix the logic around restoring previous documents

* Try to reopen documents also after `cluster-connect` is canceled

* canRestoreDocuments -> hasDocumentsToReopen

* Disallow parallel `setActiveWorkspace` calls (#50384)

* Allow passing abortSignal to `open*Modal` methods, allow closing everything at once

* Close all dialogs when activating a deep link

* Allow only one `setActiveWorkspace` execution at a time

* Review comments

* Always unregister event listeners when a dialog is closed

* Lint

* Add a diagram for launching a deep link

* Remove checking if the signal is aborted in `openImportantDialog`, rename it

(cherry picked from commit 8e9b004)
@gzdunek gzdunek added the no-changelog Indicates that a PR does not require a changelog entry label Jan 3, 2025
@github-actions github-actions bot requested review from avatus and ravicious January 3, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport no-changelog Indicates that a PR does not require a changelog entry size/lg ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants