Hello,
I want to contemplate how Temporal handles (or not) race conditions with timestamped events.
Let’s suppose we have a workflow that updates the product price. Imagine a scenario when two sequential events are produced: “change to $10” and “change to $20.” - as a result, we want our product price to be $20.
The payload might look like this:
Event 1:
{
"product": 1,
"price": 10,
"timestamp": 001
}
Event 2:
{
"product": 1,
"price": 20,
"timestamp": 002
}
Sadly, due to network latency issues, the second event arrives before the first one - workflow changes the price to $20, then the second message arrives and changes the price to $10.
I know we could implement some logic on the Activity side, but are there any Temporal capabilities for handling such a case?