Skip to content

Commit

Permalink
[service-bus] Making BatchingReceiver properly cleanup after an abort (
Browse files Browse the repository at this point in the history
…#13073)

Some more fixes related to the prior PRs around making BatchingReceiver behavior consistent:

* When we are closed (without error) or if we're in receiveAndDelete mode, we use the setTimeout() to ensure that we run after all pending message callbacks have fired
* We always cleanup our handlers before resolve/reject and it's made more clear if we're resolving immediately or resolving after pending message callbacks.

I also did some small refactors to make unit testing a bit easier, which should help make it simpler to validate this code path in the future.

Fixes #12922
  • Loading branch information
richardpark-msft authored Jan 7, 2021
1 parent 8c30af4 commit a72e5e2
Show file tree
Hide file tree
Showing 4 changed files with 214 additions and 184 deletions.
2 changes: 2 additions & 0 deletions sdk/servicebus/service-bus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- Fix the `isNode` check to allow the package to be usable in Electron. [Bug 12983](https://github.com/Azure/azure-sdk-for-js/issues/12983)
- Fix issue where receiveMessages might return fewer messages than were received, causing them to be potentially locked or lost.
[PR 12772](https://github.com/Azure/azure-sdk-for-js/pull/12772)
[PR 12908](https://github.com/Azure/azure-sdk-for-js/pull/12908)
[PR 13073](https://github.com/Azure/azure-sdk-for-js/pull/13073)
- Updates documentation for `ServiceBusMessage` to call out that the `body` field
must be converted to a byte array or `Buffer` when cross-language
compatibility while receiving events is required.
Expand Down
Loading

0 comments on commit a72e5e2

Please sign in to comment.