[#1858] Don't treat removeCmdHandlingAdapterInstance 404 as error #1926
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.
This is for #1858 and replaces #1922:
"Command handling adapter instance" entries may expire.
Therefore, getting a NOT FOUND result when invoking
removeCommandHandlingAdapterInstance()
shouldn't be treated as an error.For that, the
DeviceConnectionClient.removeCommandHandlingAdapterInstance
method has been changed to return aFuture<Boolean>
now (instead ofFuture<Void>
), with afalse
value returned if a NOT FOUND was received from the server.When a command consumer is closed, the
removeCommandHandlingAdapterInstance
method is still called every time - just to be on the safe side, even though the entry might have been already deleted because it has expired.