-
Notifications
You must be signed in to change notification settings - Fork 35
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
chore: browser database name should contain a valid DevWorkspace identifier #273
Conversation
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
Pull Request images published ✨ |
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
Pull Request images published ✨ |
3 similar comments
Pull Request images published ✨ |
Pull Request images published ✨ |
Pull Request images published ✨ |
code/src/vs/workbench/services/workspaces/browser/che/devWorkspaceId.ts
Outdated
Show resolved
Hide resolved
@@ -30,5 +31,5 @@ export function getSingleFolderWorkspaceIdentifier(folderUri: URI): ISingleFolde | |||
} | |||
|
|||
function getWorkspaceId(uri: URI): string { | |||
return hash(window.location.href + uri.toString()).toString(16); | |||
return getDevWorkspceId() || hash(uri.toString()).toString(16); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that using only DevWorkspaceID as a VS Code's Workspace ID will bring another problem.
Let's consider the situation when the user has a DevWorkspace with the Che-Code sources cloned, but she wants to open just a subfolder, e.g.: launcher
. In such a case, these two different VS Code Workspaces (che-code
and che-code/launcher
) will share the same IndexedDB. This means the user will get the same stored state of VS Code (panels layout, opened files, etc.) in both workspaces which is not expected, probably.
WDYT @vitaliy-guliy ?
If we decide we should avoid such a situation I suggest generating a hash value from the DevWorkspace ID as well: hash(getDevWorkspceId() + uri.toString()).toString(16)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, in this case we will definitely have the unique ID 😀
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
Pull Request images published ✨ |
Build 3.10 :: code_3.x/853: Console, Changes, Git Data |
Build 3.10 :: code_3.x/852: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.x/4546: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.x/4547: Console, Changes, Git Data |
Build 3.10 :: push-latest-container-to-quay_3.x/3180: Console, Changes, Git Data |
Build 3.10 :: get-sources-rhpkg-container-build_3.x/4340: code : 3.x :: Build 55334593 : quay.io/devspaces/code-rhel8:3.10-19 |
Build 3.10 :: code_3.x/853: Upstream sync done; /DS_CI/sync-to-downstream_3.x/4546 triggered |
Build 3.10 :: update-digests_3.x/4228: Console, Changes, Git Data |
Build 3.10 :: operator-bundle_3.x/2028: Console, Changes, Git Data |
Build 3.10 :: push-latest-container-to-quay_3.x/3181: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.x/4549: Console, Changes, Git Data |
Build 3.10 :: get-sources-rhpkg-container-build_3.x/4341: code : 3.x :: Build 55334655 : quay.io/devspaces/code-rhel8:3.10-20 |
Build 3.10 :: code_3.x/852: Upstream sync done; /DS_CI/sync-to-downstream_3.x/4547 triggered |
Build 3.10 :: push-latest-container-to-quay_3.x/3182: Console, Changes, Git Data |
Build 3.10 :: copyIIBsToQuay/1866: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.x/4549: Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.x/4342 triggered; /job/DS_CI/job/dsc_3.x triggered; |
Build 3.10 :: operator-bundle_3.x/2028: Upstream sync done; /DS_CI/sync-to-downstream_3.x/4549 triggered |
Build 3.10 :: dsc_3.x/1334: Console, Changes, Git Data |
Build 3.10 :: update-digests_3.x/4228: Detected new images: rebuild operator-bundle |
Build 3.10 :: update-digests_3.x/4229: Console, Changes, Git Data |
Build 3.10 :: update-digests_3.x/4229: No new images detected: nothing to do! |
Pull Request images published ✨ |
1 similar comment
Pull Request images published ✨ |
…tifier (#273) * feat: use DevWorkspace ID to form browser database identifier Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
What does this PR do?
Uses a real workspace identifier taken from env.DEVWORKSPACE_ID to form the name of browser-based database.
What issues does this PR fix?
eclipse-che/che#22338
How to test this PR?
Application
. In theStorage
section below expandIndexedDB
and remove all the databasesDEVWORKSPACE_ID
[1] ensure there is a database containing the ID at the end
go to the dasboard, delete workspace, create a workspace using the same URI
[2] check the workspace ID and check, that there is another database with this ID has been created
Browse URL must be the same for both workspaces.