Improve handling of Client Reply Context and SET requests #254
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.
The Client was missing a way of communicating the reply context back to the caller for synchronous get requests, instead returning the request context. This led to missing information and was inconsistent with the async get and subscriptions, where the actual reply context was used.
For async get and subscriptions, the code for returning the context only worked for actual context objects, but was broken if the Context type was unspecified, in which case a map will be returned.
Also in the Future there was a (small) chance of a race condition, that was never observed, but from a logic standpoint, the atomic flag should only be set after the result object has been set.
Finally in the Worker, the replyContext caused lots of duplicate entries because it appended all fields from the request AND the reply context instead of just the reply context.
For set requests it was also not possible to pass arbitrary Objects by passing
BinaryDatathe same way it is possible for GET.In the CI this also fixes a few warnings.