Technology

Engineering record

EngineIn use

Deciding rejections before changing state

Even when a save was canceled, the state in memory and the requests could already have changed. Instead of adding a way to undo them, we decide every rejection before changing state.

When a function returns an error, the save is canceled. So it's easy to think every change was rolled back with it. But memory that changed before the error, or a request already taken out of a queue, doesn't roll back with the save. The database went back to its earlier state, while memory may have changed already.

What about adding intermediate savepoints, or wrapping the function again? Then we'd have more to roll back and more to keep track of, and if we miss even one thing that changed, the same problem remains. A better question than “how do we roll back?” was “why are we rejecting after the change?”

Everything that can be rejected now gets judged before the first write. Once something has changed, we don't reject anymore. If a device or the server fails later, we don't use that as a reason to undo what came before. We save it as a failure that really happened. Rejecting a request and trying but failing are different facts.

To see how widespread this problem is, we picked 128 functions and read them by hand. We found defects with the same cause: 4 certain and 2 likely. For four groups of suspected paths, we couldn't find a way they're actually reached. Not finding one doesn't mean it can't happen, but we decided not to add new machinery to block every path. We fix the order first.

Written from that day’s point of view, using the documents and change history of the time. Published 2026.12.01.