Replies: 1 comment
-
Hey, thanks for starting a discussion. This is indeed on my list somewhere to implement :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using the API to update transactions through this flow:
EndToEndID: NOTPROVIDED
from the description) locallyMy worry is that I'll at some point be acting on stale data, i.e. some rule or something else has changed the data meanwhile and I'll be updating the transaction, potentially wiping out their changes. I am already only PUT'ing the fields I update to avoid collisions
Would it be possible to utilize the
412 Precondition Failed
status code for doing "Optimistic locking"? See https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests#avoiding_the_lost_update_problem_with_optimistic_locking for details. I see that theupdated_at
timestamp is already present on the transaction when I fetch it, so it should "just" be a matter of comparing a header value with that value and rejecting with 412 if it's violated.Beta Was this translation helpful? Give feedback.
All reactions