Skip to content

fix(email): avoid undefined in subjectless replies and forwards #5703

Description

@Whxuan0701

Summary

Replying to or forwarding an email without a subject currently produces the literal subjects Re: undefined and Fwd: undefined.

Current implementation

apps/web/src/features/block-email/util/subjectText.ts interpolates replyingTo.subject directly for both paths. ApiMessage.subject is optional, so a subjectless message reaches the template literal as undefined.

Expected result

  • Reply and Reply All use Re: for a subjectless message.
  • Forward uses Fwd: for a subjectless message.
  • Existing subjects and existing case-insensitive Re: prefixes keep their current behavior.

Suggested direction

Normalize the optional source subject before adding the reply or forward prefix, and add focused tests in subjectText.test.ts.

Non-goals

  • Changing how subjects are displayed outside the composer.
  • Changing provider-specific or localized subject prefixes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions