-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Messenger] Remove fix NoAutoAckStamp
handling in Worker::flush()
#61291
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
[Messenger] Remove fix NoAutoAckStamp
handling in Worker::flush()
#61291
Conversation
Worker::flush()
method
This PR not only removes unused code, but changes code. Can you please add or modify an existing test case? Thanks |
1d1766d
to
bb580f1
Compare
Worker::flush()
methodNoAutoAckStamp
handling in Worker::flush()
NoAutoAckStamp
handling in Worker::flush()
NoAutoAckStamp
handling in Worker::flush()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix does make sense to me.
Ideally the test case shouldn't use reflection to hack into internal structures.
Would it be possible to use only public methods instead?
NoAutoAckStamp
handling in Worker::flush()
NoAutoAckStamp
handling in Worker::flush()
bb580f1
to
1d3caf6
Compare
That's the best I could come up with. Using only minimal Reflection to fill the |
The line `$envelope = $envelope->withoutAll(NoAutoAckStamp::class);` was modifying a local variable that was never used after assignment. This change moves the stamp removal to the catch block where it's actually needed, ensuring envelopes stored for acknowledgment don't contain contradictory NoAutoAckStamp.
1d3caf6
to
06b1d8f
Compare
Thank you @wazum. |
Description
This PR removes unused code in the
Worker::flush()
method where an envelope modification was never used.Changes
$envelope = $envelope->withoutAll(NoAutoAckStamp::class);
which was modifying a local variable that was immediately discardedNoAutoAckStamp
removal to the catch block where it's actually neededWhy this change?
The line was unused code because:
dispatch()
succeeds: The modified envelope is never used (foreach continues/ends)dispatch()
throws: The line is never reachedMoving 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.