-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix handling of resending messages during a disconnect.
The unit tests for this had a fatal flaw - they assumed that if the connection dropped, we'd get nothing back for any in-flight messages. This isn't true, though - we'd actually get back an error from amqplib when the underlying connection fails. This fixes the tests to reflect this. If we rely on amqplib to reject such messages, then moving all messages from _unconfirmedMessages to _messages on a reconnect now becomes superfluous. I also reworked `_publishQueuedMessages()` to be more synchronous. As it stood, I had to add a lot of pointless delays in my tests to make sure that the `then` after publishing a message had time to run. fix #152
- Loading branch information
Showing
2 changed files
with
192 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.