afterSnapshot method

  1. @override
Future<void> afterSnapshot(
  1. String documentId,
  2. Snapshot snapshot
)
override

Waits for the snapshot and the prune it caused to reach the disk.

The waiting is the point: a caller that broadcasts this snapshot has to know it survives a crash before the clients start replaying against it.

Implementation

@override
Future<void> afterSnapshot(String documentId, Snapshot snapshot) async {
  await (await _openDocument(documentId)).persistence.flush();
}