Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify the update process #42

Merged
merged 2 commits into from
Nov 4, 2024
Merged

simplify the update process #42

merged 2 commits into from
Nov 4, 2024

Conversation

DoctorVin
Copy link
Contributor

@DoctorVin DoctorVin commented Nov 1, 2024

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.

As described in FS-1821, the update routines for NATS KV are subject
to errors where the published 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.
Copy link
Collaborator

@jakeschuurmans jakeschuurmans left a comment

Choose a reason for hiding this comment

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

Looks good to me. I like the re-arch of update a lot. Way cleaner IMO.

status.go Show resolved Hide resolved
status.go Show resolved Hide resolved
status.go Show resolved Hide resolved
@DoctorVin DoctorVin merged commit 3e5ff70 into main Nov 4, 2024
6 checks passed
@DoctorVin DoctorVin deleted the vc/fix-updates branch November 4, 2024 14:43
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.

3 participants