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

Fix multiworkspace mode returning inactive workspaces #9011

Closed

Conversation

Weiko
Copy link
Member

@Weiko Weiko commented Dec 10, 2024

Context

Currently we return all the workspaces of a current user, including inactive ones.
This means when we switch to the other workspace through the UI, we are redirected to a workspace that is possibly in a broken state.

Before (with Toto being an INACTIVE workspace)
Screenshot 2024-12-10 at 17 31 22

After
Screenshot 2024-12-10 at 17 30 52

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds workspace activation status filtering to the currentUser query, preventing users from accessing inactive workspaces in multi-workspace mode.

  • Added activationStatus: WorkspaceActivationStatus.ACTIVE filter in currentUser query within /packages/twenty-server/src/engine/core-modules/user/user.resolver.ts
  • Modified workspace relation query to include activation status check in user resolver
  • Ensures users can only switch between active workspaces in the UI dropdown

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@Weiko
Copy link
Member Author

Weiko commented Dec 10, 2024

Closing, let's do this on the FE side instead

@charlesBochet charlesBochet deleted the c--fix-multi-workspace-returning-inactive-workspaces branch January 10, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants