Updates to implementation details based on today's call –
-
On an update call, make the client send a "snapshot" of the current record, along with the incoming
UPDATE
payload and save these to cache. Let's call thisv1
. -
Generate the UPDATE query, execute it, and return the updated payload as usual, along with a unique
undo_id
. Additionally, save these to cache as well. Let's call thisv2
. -
Now if the API consumer needs an undo, they need to send the
undo_id
, with which we should be able to look up both thev1
record, thev2
record, do a diff and execute a newUPDATE
query that rolls backv2
tov1
.