-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
refactor(domain-manager): improve default workspace resolution #10282
refactor(domain-manager): improve default workspace resolution #10282
Conversation
Refactor logic for determining the default workspace in single-workspace mode. Added fallback to Apple workspace when multiple workspaces are found and updated validations to ensure a workspace is always returned. Simplified handling of scenarios where multi-workspace mode is enabled.
Updated the log message for single-workspace mode to improve clarity. The warning now explicitly states the number of workspaces found and specifies that the Apple workspace will be used as fallback.
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.
PR Summary
This PR refactors the workspace resolution logic in single-workspace mode to improve reliability and simplify the codebase, focusing on better default workspace handling and fallback mechanisms.
- Added fallback to Apple workspace (SEED_APPLE_WORKSPACE_ID) when multiple workspaces are found in
/packages/twenty-server/src/engine/core-modules/domain-manager/services/domain-manager.service.ts
- Removed complex DEFAULT_SUBDOMAIN lookup logic in favor of a more straightforward approach
- Enhanced validation to ensure a workspace is always returned in single-workspace mode
- Improved error handling for multi-workspace mode scenarios with clearer validation checks
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
...ages/twenty-server/src/engine/core-modules/domain-manager/services/domain-manager.service.ts
Outdated
Show resolved
Hide resolved
Fixed a punctuation issue in the log message for single-workspace mode. Improved readability by adding proper sentence structure and clarity.
…services/domain-manager.service.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…kspace-in-single-workspace-mode
I think the help of @Weiko or @charlesBochet is necessary to merge this PR since integration CI might be blocking your merge |
Thanks @AMoreaux for your contribution! |
Refactor logic for determining the default workspace in single-workspace mode. Added fallback to Apple workspace when multiple workspaces are found and updated validations to ensure a workspace is always returned. Simplified handling of scenarios where multi-workspace mode is enabled.