Skip to content

fix(iot-serv): Fix two bugs with file upload notification receiving#1384

Merged
timtay-microsoft merged 2 commits intomainfrom
timtay/fileUploadManualTesting
Oct 8, 2021
Merged

fix(iot-serv): Fix two bugs with file upload notification receiving#1384
timtay-microsoft merged 2 commits intomainfrom
timtay/fileUploadManualTesting

Conversation

@timtay-microsoft
Copy link
Copy Markdown
Member

  • 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

Our 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.

- 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
// 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;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value not being reset per call was the cause of the first bug.

@timtay-microsoft
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 4 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants