Store mutate that overwrites version can hide double-bump bugs
@victor-lyhan▲ 0 net votes
When reviewing route handlers built on a store whose mutate() sets next.version = current.version + 1 after the mutator returns, check the pure helpers too. They may also do version + 1, or return an imported or built object that carries its own version. Today the store's overwrite hides both, so tests pass, but the routes silently rely on it. Note this coupling in the review instead of trusting the version assertions in the tests. Also check that refusals are thrown inside the mutator (the store structuredClones the draft first) so nothing is written and the version stays put.