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

Opening and closing file from search fails on spaces overview #11978

Closed
JammingBen opened this issue Nov 27, 2024 · 9 comments · Fixed by #12000
Closed

Opening and closing file from search fails on spaces overview #11978

JammingBen opened this issue Nov 27, 2024 · 9 comments · Fixed by #12000
Assignees
Labels
Priority:p3-medium Normal priority Type:Bug Something isn't working

Comments

@JammingBen
Copy link
Contributor

Describe the bug

Opening and closing a file from search preview fails on the spaces overview page.

Steps to reproduce

  1. Upload a text file to your personal space
  2. Go to "Spaces"
  3. Open the right sidebar
  4. Search for the text file
  5. Open the text file from the search preview
  6. Close the editor again

Expected behavior

The editor is being closed, everything works as expected.

Actual behavior

The UI basically dies and becomes unusable, console logs space?.canListVersions.

@JammingBen JammingBen added Type:Bug Something isn't working Priority:p3-medium Normal priority labels Nov 27, 2024
@JammingBen JammingBen moved this from Qualification to Prio 3 or less in Infinite Scale Team Board Nov 27, 2024
@LukasHirt
Copy link
Collaborator

The UI basically dies and becomes unusable, console logs space?.canListVersions.

I am getting that error in the console as well but the UI does not really die and I am able to continue my work. Strange...

@JammingBen
Copy link
Contributor Author

The UI basically dies and becomes unusable, console logs space?.canListVersions.

I am getting that error in the console as well but the UI does not really die and I am able to continue my work. Strange...

It only happened when the right sidebar was open, if I remember correctly. Otherwise I only had the console error as well.

@LukasHirt
Copy link
Collaborator

It only happened when the right sidebar was open

Makes no difference whether it's opened or closed in my case.

@LukasHirt
Copy link
Collaborator

console logs space?.canListVersions.

Seems like once the text editor is exited, the file is somehow selected as a space. I guess that's not the expected behaviour.

@LukasHirt
Copy link
Collaborator

the file is somehow selected as a space.

@JammingBen Should file be ever allowed to be selected as space? My understanding was that space is more of a directory.

@JammingBen
Copy link
Contributor Author

Makes no difference whether it's opened or closed in my case.

Hmm strange, I just retried it and it still completely breaks for me 🤔

@JammingBen Should file be ever allowed to be selected as space? My understanding was that space is more of a directory.

What exactly do you mean by "the file is selected as a space"? But it sounds really weird yes, a space behaves more like a directory in general.

@LukasHirt
Copy link
Collaborator

What exactly do you mean by "the file is selected as a space"?

There's a prop on the file sidebar component called space which kind of seems to me like it should be the space itself? I might be missing some context here but this basically just grabs any resource that is selected and then passes it to the sidebar via the space prop:

return unref(selectedResources)[0] as ProjectSpaceResource

@JammingBen
Copy link
Contributor Author

Ahh okay, yes this is definitely weird. The selectedResources should be pruned after closing the editor in this case (and I think they are eventually? Otherwise the resource would show in the right sidebar I think). Maybe just adding a check like isProjectSpaceResource(unref(selectedResources)[0]) here helps?

Also, I just noticed out that Web only dies when using the dev server via pnpm vite, but not in a regular build. Are you using the dev server?

@LukasHirt
Copy link
Collaborator

Also, I just noticed out that Web only dies when using the dev server via pnpm vite, but not in a regular build. Are you using the dev server?

Ah, okay, this was the difference. Dev server dies for me as well.

Maybe just adding a check like isProjectSpaceResource(unref(selectedResources)[0]) here helps?

Just did a simple filter with type space and both dying and the error are gone. I'll adjust it to use the isProjectSpaceResource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p3-medium Normal priority Type:Bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants