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

create a new workspace id in the local if the deleted NDEx workspace UUID is same as the local workspace UUID #403

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

yihangx
Copy link
Member

@yihangx yihangx commented Jan 22, 2025

Copy link

netlify bot commented Jan 22, 2025

Deploy Preview for voluble-rugelach-5a3809 ready!

Name Link
🔨 Latest commit 25dfa5f
🔍 Latest deploy log https://app.netlify.com/sites/voluble-rugelach-5a3809/deploys/6790b373e13070000807b7e0
😎 Deploy Preview https://deploy-preview-403--voluble-rugelach-5a3809.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@GAOChengzhan GAOChengzhan left a comment

Choose a reason for hiding this comment

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

@yihangx Hi Yihang,

I think these changes are unrelated to the bug. Please read the ticket carefully.

The root of this bug is in "Save Workspace Overwrite" menu item, it checks the workspace exist or not based on whether the currentWorkspaceId is in the list props.workspaceId: link.

  const hasWorkspace = props.existingWorkspace
    .map((workspace) => workspace.workspaceId)
    .includes(currentWorkspaceId)

I think you need to refer to this line: add a function call here to delete the target workspace in indexed DB sothat it can further trigger the menu to fetch the latest workspace info from server

if (selectedWorkspace) {
        const ndexClient = new NDEx(ndexBaseUrl)
        const token = await getToken()
        ndexClient.setAuthToken(token)
        await ndexClient.deleteCyWebWorkspace(selectedWorkspace.workspaceId)
        //
        // add a function call here to delete the workspace in indexed DB
        //
      }

Let me know if this can really resolve the bug

@GAOChengzhan
Copy link
Contributor

GAOChengzhan commented Jan 25, 2025

Hi Yihang @yihangx,

I now understand the rationale behind the changes you implemented. I do apologize that I previously misunderstood your intention.

While your update addresses the immediate issue mentioned in the ticket, the underlying problem is that the local index DB is out of sync. This misalignment leads to additional bugs. For example, if you have a workspace named 'A' in your account and open another called 'B', then delete 'A', you should be able to rename 'B' to 'A' and save it without encountering any name conflicts(by calling Data -> Save Workspace As...). However, currently, this scenario triggers a name conflict warning.

I will bring this up on next Monday meeting and discuss with Jing, Dylan and Kei. We should probably add some deleteWorkspace method in db.ts and resolve this bug completely.

@GAOChengzhan GAOChengzhan merged commit 7cd1a05 into development Jan 27, 2025
4 checks passed
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.

2 participants