Skip to content

Conversation

@weaverryan
Copy link
Member

Q A
Branch? master
Bug fix? yes - I think so
New feature? no
BC breaks? no (feature only on master)
Deprecations? no
Tests pass? yes
Fixed tickets none
License MIT
Doc PR a lot, soon :)

This purpose of this event is to be a hook when a message is sent to a transport.
If that message is redelivered later, that's not the purpose of this hook (there
are Worker events for that) and could cause problems if the user unknowingly
tries to modify the Envelope in some way, not thinking about how this might
be a redelivery message.

This purpose of this event is to be a hook when a message is sent to a transport.
If that message is redelivered later, that's not the purpose of this hook (there
are Worker events for that) and could cause problems if the user unknowingly
tries to modify the Envelope in some way, not thinking about how this might
be a redelivery message.
@weaverryan
Copy link
Member Author

Ready!

@fabpot
Copy link
Member

fabpot commented Mar 26, 2019

Thank you @weaverryan.

@fabpot fabpot merged commit 3ac6bf9 into symfony:master Mar 26, 2019
fabpot added a commit that referenced this pull request Mar 26, 2019
…liver (weaverryan)

This PR was merged into the 4.3-dev branch.

Discussion
----------

Avoid dispatching SendMessageToTransportsEvent on redeliver

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes - I think so
| New feature?  | no
| BC breaks?    | no (feature only on master)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | a lot, soon :)

This purpose of this event is to be a hook when a message is sent to a transport.
If that message is redelivered later, that's not the purpose of this hook (there
are Worker events for that) and could cause problems if the user unknowingly
tries to modify the Envelope in some way, not thinking about how this might
be a redelivery message.

Commits
-------

3ac6bf9 Avoid dispatching SendMessageToTransportsEvent on redeliver
@weaverryan weaverryan deleted the event-not-on-retry branch March 26, 2019 15:52
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019
@fabpot fabpot mentioned this pull request May 9, 2019
nicolas-grekas added a commit that referenced this pull request Oct 20, 2025
This PR was merged into the 7.4 branch.

Discussion
----------

[Messenger] Simplify code

| Q             | A
| ------------- | ---
| Branch?       | 7.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Noticed while working on #61843.

There's no reason for the event to be dispatched inside the loop anymore:

1. The event was [originally dispatched outside the loop](#30650).
2. It was later [moved inside the loop](#30676) because of the retry mechanism.
3. [The retry mechanism was later extracted](#34185), so there's no longer a need for the event to be dispatched inside the loop.

Commits
-------

beeb4b9 [Messenger] Simplify code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants