-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 error messages on sign up #10399
Conversation
@@ -63,11 +63,19 @@ export class WorkspaceManagerService { | |||
workspaceId: string; | |||
userId: string; | |||
}): Promise<void> { | |||
const schemaCreationStart = performance.now(); |
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.
Temporarily adding these logs to troubleshoot prod performance on workspace creation (~15s in prod) and see what optimizations we can do while keeping 2k5 workspaces on prod
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.
I think there is a decorator for that
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.
Ah never mind, you don't want log for the whole function
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 workspace activation status checks across the frontend codebase, introducing performance monitoring on the backend. Here's a concise summary of the key changes:
- Introduced new
useIsWorkspaceActivationStatusEqualsTo
hook in/packages/twenty-front/src/modules/workspace/hooks/useIsWorkspaceActivationStatusEqualsTo.ts
for flexible workspace status checks - Replaced
useIsWorkspaceActivationStatusSuspended
with the new hook across multiple components for more consistent status checking - Added performance logging in
/packages/twenty-server/src/engine/workspace-manager/workspace-manager.service.ts
to measure workspace initialization steps - Added detailed timing metrics in
/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.service.ts
for metadata sync operations - Changed workspace status checks from negative (suspended) to positive (active) conditions in prefetch components for better readability
The changes improve code maintainability while adding valuable performance insights for debugging and monitoring.
11 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
`Metadata creation took ${dataSourceMetadataCreationEnd - dataSourceMetadataCreationStart}ms`, | ||
); | ||
|
||
const permissionsEnabledStart = performance.now(); | ||
const permissionsEnabled = | ||
await this.permissionsService.isPermissionsEnabled(); |
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.
style: Explicit boolean comparison with === true is redundant
await this.permissionsService.isPermissionsEnabled(); | |
if (permissionsEnabled) { |
this.logger.log( | ||
`Workspace object migrations took ${workspaceObjectMigrationsEnd - workspaceObjectMigrationsStart}ms`, | ||
); |
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.
style: use this.logger.log() instead of console.log() for consistent logging and production environments
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.
LGTM
In this PR: