Skip to content

Fix workspaceLogo in invite-email signed twice#15673

Merged
martmull merged 1 commit intomainfrom
fix-send-email-workspace-logo-path
Nov 6, 2025
Merged

Fix workspaceLogo in invite-email signed twice#15673
martmull merged 1 commit intomainfrom
fix-send-email-workspace-logo-path

Conversation

@martmull
Copy link
Copy Markdown
Contributor

@martmull martmull commented Nov 6, 2025

as title

@martmull martmull enabled auto-merge (squash) November 6, 2025 13:58
Copy link
Copy Markdown
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.

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 resendWorkspaceInvitation method which already follows this pattern

Minor cleanup needed:

  • FileService import (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
Loading

Additional Comments (2)

  1. packages/twenty-server/src/engine/core-modules/workspace-invitation/workspace-invitation.resolver.ts, line 4 (link)

    style: unused import - FileService is no longer used in this file

  2. packages/twenty-server/src/engine/core-modules/workspace-invitation/workspace-invitation.resolver.ts, line 38 (link)

    style: unused dependency - fileService is no longer used after removing the duplicate signing logic

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@martmull martmull linked an issue Nov 6, 2025 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 6, 2025

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

@martmull martmull merged commit b00c36a into main Nov 6, 2025
56 of 59 checks passed
@martmull martmull deleted the fix-send-email-workspace-logo-path branch November 6, 2025 14:13
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.

File upload error

2 participants