in src/stm.ts [171:191]
public addNotChangedChecks(cmp: Builder.ComparatorBuilder, sinceBeforeMod: string) {
if (sinceBeforeMod === 'Infinity') {
return; // no reads were made
}
this.ops.forEach(op => {
switch (op.op) {
case WriteKind.Write:
cmp.and(op.req.key!, 'Mod', '<', sinceBeforeMod);
break;
case WriteKind.DeleteKey:
cmp.and(op.key, 'Mod', '<', sinceBeforeMod);
break;
case WriteKind.DeleteRange:
// error, no way to check that every single key in that range is the same
throw new Error(`You cannot delete ranges in the SerializableSnapshot isolation level`);
default:
throw new ClientRuntimeError(`Unexpected write op ${JSON.stringify(op)}`);
}
});
}