Fixing MessageProcessor AutoComplete handling #1814
Merged
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.
Related to Functions issue Azure/azure-functions-host#2066 where users need the ability to control completion behavior for successful function invocations. In part of the discussion of that issue, it was pointed out that even when OnMessageOptions.AutoComplete is set to false, we still call complete! This logic was added a long time ago (in this commit) and I don't think it is correct. When you set AutoComplete to false, you're saying that in the absence of an exception, you want to control the message state yourself (e.g. call Complete/DeadLetter/etc.).
The default for AutoComplete is true, so this change will only affect people who have changed the default. Technically it is a breaking change, but given that this won't affect default users, and the behavior when set to false doesn't make any sense, I'm comfortable making the change in a minor version release as a bug fix. Note that for Azure Functions users, since we don't currently allow you to configure AutoComplete, it isn't breaking there.
Will make the same change in dev.