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

Adapt VS Code’s Workspace state restoration feature to Che world #148

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

azatsarynnyy
Copy link
Member

@azatsarynnyy azatsarynnyy commented Nov 11, 2022

What does this PR do?

As I described in eclipse-che/che#21813 (comment), VS Code's Workspace state restoration feature doesn't work exactly as the Che user would expect. In short: VS Code manages the Workspaces states by the Workspace internal ID (actually URI) ignoring the fact that different DevWorkspaces can host the VS Code Workspaces with the same internal ID. That leads to such problems as described in eclipse-che/che#21813.

This PR adapts VS Code’s Workspace state restoration feature to Che in such a way that VS Code manages its Workspaces states by DevWorkspace ID + VS Code Workspace's internal ID.

More technical details

With this patch, Che-Code will start including the DevWorkspace ID in VS Code's Workspace ID. As the VS Code Workspace's internal ID is used as a corresponding Database's name suffix in the browser's IndexedDB Storage, these change leads to VS Code Workspace Storage save data not only per VS Code Workspace internal ID, but per a combination of DevWorkspace ID + VS Code Workspace's internal ID

What issues does this PR fix?

eclipse-che/che#21813

How to test this PR?

  1. Start a new DevWorkspace with the Che-Code editor image quay.io/che-incubator-pull-requests/che-code:pr-148-amd64 or use my test project https://github.com/azatsarynnyy/java-spring-petclinic/tree/ws-storage.
  2. Try to open a few files and run some Tasks.
  3. Try to restart DevWorkspace. VS Code should restore its state (e.g. reopen the files, show the recently running Tasks).
  4. Remove DevWorkspace.
  5. Start a new DevWorkspace with the same project.
  6. VS Code should start the "clean" Workspace and should not try to restore the state of its Workspace as it's a new DevWorkspace.

@azatsarynnyy azatsarynnyy changed the title [WIP] Test [WIP] Adapt VS Code’s Workspace state restoration feature to Che world Nov 13, 2022
Signed-off-by: Artem Zatsarynnyi <azatsary@redhat.com>
@azatsarynnyy azatsarynnyy changed the title [WIP] Adapt VS Code’s Workspace state restoration feature to Che world Adapt VS Code’s Workspace state restoration feature to Che world Nov 14, 2022
@azatsarynnyy azatsarynnyy marked this pull request as ready for review November 14, 2022 16:11
@azatsarynnyy azatsarynnyy enabled auto-merge (rebase) November 14, 2022 16:11
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.

3 participants