Future<void> flush(int stepIndex) async { final snapshot = _snapshots.remove(stepIndex); if (snapshot != null) await _recordDiff(stepIndex, snapshot); }