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.
As described in FS-1821, the update routines for NATS KV are subject to errors where the publisher gets out of sync with the state of the KV store. Because we always retrieve the last state of the KV before updating, it is easier to not try and track the KV revision on the publisher object and instead simply use the revision we just retrieved to make the update.
I deprecated the notion of "ts_only" updates, which can be accomplished as-easily by simply resubmitting the state and status of the task, and indeed must be included because they are not variadic arguments in the signature of the function. I also eliminated a bunch of application-level validation code in here that was misplaced. The only validation left at the level of the Publish method is the rule that a completed condition (that is one in a successful or failed state) may not be modified further.