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(workspace): clean up resolver and improve error handling #9225

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

AMoreaux
Copy link
Contributor

Removed unused LoginTokenService imports and dependencies for better code clarity. Enhanced error handling in getPublicWorkspaceDataBySubdomain with a try-catch block, ensuring consistent exception handling. This improves maintainability and robustness of the resolver.

Removed unused `LoginTokenService` imports and dependencies for better code clarity. Enhanced error handling in `getPublicWorkspaceDataBySubdomain` with a try-catch block, ensuring consistent exception handling. This improves maintainability and robustness of the resolver.
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

Refactored workspace resolver to improve error handling and remove unused dependencies, focusing on the getPublicWorkspaceDataBySubdomain method and overall code clarity.

  • Incorrect error message in currentWorkspace method states "User not found" instead of "Workspace not found" in /packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
  • Missing return statement after error handler in updateWorkspace method could cause undefined responses
  • Error handling in getPublicWorkspaceDataBySubdomain may not properly propagate errors due to similar missing return
  • Removed unused LoginTokenService import for better code maintainability

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

Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

LGTM

@Weiko Weiko merged commit 53f0cd7 into main Dec 24, 2024
22 checks passed
@Weiko Weiko deleted the fix/avoid-500-error branch December 24, 2024 13:41
Copy link

Thanks @AMoreaux for your contribution!
This marks your 39th 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants