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

refactor(domain-manager): improve default workspace resolution #10282

Merged
merged 8 commits into from
Feb 19, 2025

Conversation

AMoreaux
Copy link
Contributor

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.

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.
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 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

AMoreaux and others added 3 commits February 18, 2025 10:07
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>
@AMoreaux AMoreaux enabled auto-merge (squash) February 18, 2025 09:10
@guillim
Copy link
Contributor

guillim commented Feb 18, 2025

I think the help of @Weiko or @charlesBochet is necessary to merge this PR since integration CI might be blocking your merge

@AMoreaux AMoreaux merged commit c0014cf into main Feb 19, 2025
32 checks passed
@AMoreaux AMoreaux deleted the fix/manage-multiworkspace-in-single-workspace-mode branch February 19, 2025 09:06
Copy link
Contributor

Thanks @AMoreaux for your contribution!
This marks your 94th PR on the repo. You're top 1% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

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.

3 participants