Fix workspaceLogo in invite-email signed twice#15673
Conversation
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
Removed duplicate workspace logo URL signing in the sendInvitations resolver method. Previously, the logo was being signed twice: once in the resolver before passing to the service, and again inside the service when building the email data. This fix ensures the logo is only signed once at the service layer (line 301-306 in workspace-invitation.service.ts), which is the correct location since it's closer to where the signed URL is actually used in the email template.
Key changes:
- Removed unnecessary logo signing logic from resolver (lines 91-98)
- Now passes the workspace entity directly to the service
- Consistent with
resendWorkspaceInvitationmethod which already follows this pattern
Minor cleanup needed:
FileServiceimport (line 4) and injection (line 38) are now unused and should be removed
Confidence Score: 4/5
- This PR is safe to merge with minimal risk - it fixes a legitimate bug where URLs were being double-signed
- Score reflects a solid bug fix that removes duplicate logic and improves code consistency. The change is straightforward and aligns with existing patterns (resendWorkspaceInvitation already works this way). Minor deduction for unused imports/dependencies that should be cleaned up for code hygiene.
- No files require special attention - the change is localized and the logic is moved to the appropriate layer
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| packages/twenty-server/src/engine/core-modules/workspace-invitation/workspace-invitation.resolver.ts | 4/5 | Removed duplicate workspace logo signing logic; unused FileService import and dependency should be cleaned up |
Sequence Diagram
sequenceDiagram
participant Client
participant Resolver as WorkspaceInvitationResolver
participant Service as WorkspaceInvitationService
participant FileService
participant EmailService
Client->>Resolver: sendInvitations(emails, workspace)
Note over Resolver: After fix: Pass workspace<br/>entity directly (no signing)
Resolver->>Service: sendInvitations(emails, workspace, sender)
loop For each email
Service->>Service: createWorkspaceInvitation(email, workspace)
Service->>Service: Build invitation link
Note over Service,FileService: Sign workspace logo URL<br/>for email template
Service->>FileService: signFileUrl(workspace.logo, workspaceId)
FileService-->>Service: Signed logo URL
Service->>Service: Build email data with signed logo
Service->>EmailService: send(email with signed logo URL)
end
Service-->>Resolver: SendInvitationsOutput
Resolver-->>Client: Result
Additional Comments (2)
-
packages/twenty-server/src/engine/core-modules/workspace-invitation/workspace-invitation.resolver.ts, line 4 (link)style: unused import -
FileServiceis no longer used in this file -
packages/twenty-server/src/engine/core-modules/workspace-invitation/workspace-invitation.resolver.ts, line 38 (link)style: unused dependency -
fileServiceis no longer used after removing the duplicate signing logic
1 file reviewed, 2 comments
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:18887 This environment will automatically shut down when the PR is closed or after 5 hours. |
as title