Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Mailer] Redundant MessageEvent dispatch #34972

Closed
@raneomik

Description

@raneomik

Symfony version(s) affected: 4.4.1

Description

When only one email is sent in a Symfony application having also the Messenger component, two MessageEvents are actually dispatched.
Not sure if it is a bug or it is done on purpose, but it brings some confusion in the Web profiler where it shows a queued email in a "[main]" transport :

image

Seen also in functional tests using non-mocked, by default injected dependencies and checking sent emails count through dispatched events.

How to reproduce

In a Symfony 4.4 application in development mode (web profiler and debug activated), having Messenger component, and an implemented Mailer.
When an email is sent and Mailer is configured for 1 dsn, it should show 2 emails in web profiler, one sent by the actual configured dsn, and one queued in a "[main]" transport.

Possible Solution
Remove the MessageEvent dispatch inSymfony\Component\Mailer\Mailer:send and keep only the Messenger's MessageBus dispatch.

Additional context
The 2 MessageEvents come from :

  • dispatched inSymfony\Component\Mailer\Transport\AbstractTransport:send
  • inSymfony\Component\Mailer\Mailer:send - if MessageBus is not null (the dispatched transport in MessageEvent is an instance ofSymfony\Component\Mailer\Transport\Transports)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp