fix(iot-serv): Fix two bugs with file upload notification receiving#1384
Merged
timtay-microsoft merged 2 commits intomainfrom Oct 8, 2021
Merged
fix(iot-serv): Fix two bugs with file upload notification receiving#1384timtay-microsoft merged 2 commits intomainfrom
timtay-microsoft merged 2 commits intomainfrom
Conversation
- Fixed bug where subsequent calls to ```fileUploadNotificationReceiver.receive()``` would return the same notification if no notification was actually received - Fixed bug where calls to ```fileUploadNotificationReceiver.receive()``` would result in the SDK completing all notifications received instead of just the notification that is returned to the user
timtay-microsoft
commented
Oct 8, 2021
| // This value is set in the reactor thread once we receive the file upload notification from the service over AMQP. | ||
| // It's important to set this to null since receive may be called multiple times in a row. Otherwise, a single | ||
| // notification could be returned to the user multiple times if nothing overwrote a previous value. | ||
| fileUploadNotification = null; |
Member
Author
There was a problem hiding this comment.
This value not being reset per call was the cause of the first bug.
drwill-ms
approved these changes
Oct 8, 2021
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
This was referenced Oct 8, 2021
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fileUploadNotificationReceiver.receive()would return the same notification if no notification was actually receivedfileUploadNotificationReceiver.receive()would result in the SDK completing all notifications received instead of just the notification that is returned to the userOur existing receiver code would get a delivery from the service with 1 to many file upload notifications, but our SDK only returned one of them to the user after acknowledging all of them. To fix this, we will now limit the link credit on these receivers to 1 message. That way the service doesn't send more messages than we are prepared to return to the user.