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

[WebProfilerBundle] profiler reporting 2 emails when only 1 sent. #48004

Closed
PhilETaylor opened this issue Oct 26, 2022 · 5 comments
Closed

[WebProfilerBundle] profiler reporting 2 emails when only 1 sent. #48004

PhilETaylor opened this issue Oct 26, 2022 · 5 comments

Comments

@PhilETaylor
Copy link
Contributor

PhilETaylor commented Oct 26, 2022

Symfony version(s) affected

6.1/6.2 tested

Description

@chalasr I can now reproduce this - but I dont know if we consider this a bug - or correctly reporting what "happened".
Forked from #47992 (comment)

How to reproduce

composer create-project symfony/symfony-demo reproducer
cd reproducer
composer req symfony/messenger

(no manual configuration of messenger, just install it with composer req!)

and then send an email in the BlogController::index function (for the fun of it)

 public function index(Request $request, int $page, string $_format, PostRepository $posts, TagRepository $tags, 
MailerInterface $mailer): Response
    {
        $email = new Email();
        $email->from('phil@localhost')
            ->to('phil@localhost')
            ->subject('mySubject')
            ->text('myText');
        $mailer->send($email);

Then visit the blog route in a browser..

Then check the profiler and you see TWO emails ... 1 queued and 1 sent.

Possible Solution

I suppose this could be correct, it's queued to the bus and then sent, but do we consider this a bug in the profiler that says that there are 2 emails? maybe a solution is to remove the reporting of a queued email if it then went on to be sent.

If this is all expected behaviour and Im creating noise and false bug reports then thats cool too - Im sorry, let's just close this. At least it proves Im testing 6.2 ;-)

Additional Context

Forked from #47992 (comment)

Screenshot 2022-10-26 at 20 11 11

@carsonbot
Copy link

Hey, thanks for your report!
There has not been a lot of activity here for a while. Is this bug still relevant? Have you managed to find a workaround?

@PhilETaylor
Copy link
Contributor Author

seems it was only me, no worries, can close

@cataragak90
Copy link

Hello, have you identified the problem?

@PhilETaylor
Copy link
Contributor Author

I dont think there was a "problem" to fix really - once you understand that 2 means the one email was queued, and then later sent it makes sense.

@alexander-schranz
Copy link
Contributor

I'm running into a similar issue but in tests. Looks like this is an issue with the profiler when mailer and messenger component is installed.

For that the default messenger need to be a sync bus, what confused me more is that I don't have any message_bus configured it is still framework.mailer.message_bus: null configured.

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

No branches or pull requests

4 participants