Commit 9aa072c
committed
This PR was merged into the 6.4 branch.
Discussion
----------
[Messenger] Remove fix `NoAutoAckStamp` handling in `Worker::flush()`
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
## Description
This PR removes unused code in the `Worker::flush()` method where an envelope modification was never used.
## Changes
- Removed the line `$envelope = $envelope->withoutAll(NoAutoAckStamp::class);` which was modifying a local variable that was immediately discarded
- Moved the `NoAutoAckStamp` removal to the catch block where it's actually needed
## Why this change?
The line was unused code because:
1. If `dispatch()` succeeds: The modified envelope is never used (foreach continues/ends)
2. If `dispatch()` throws: The line is never reached
Moving the stamp removal to the `catch` block ensures that envelopes stored for acknowledgment have clean state - they shouldn't contain a "no auto ack" stamp when they're about to be acknowledged.
Commits
-------
06b1d8f [Messenger] Fix NoAutoAckStamp handling in Worker::flush()
File tree
3 files changed
+51
-1
lines changed- src/Symfony/Component/Messenger
- Tests
- Fixtures
3 files changed
+51
-1
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
584 | 586 | | |
585 | 587 | | |
586 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
587 | 632 | | |
588 | 633 | | |
589 | 634 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | 260 | | |
262 | 261 | | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| |||
0 commit comments