sync method
Waits for in-flight operations to complete and ensures the root CID is persisted.
Mutations are already write-through, so this is primarily a barrier that drains the mutation lock and re-persists the current root.
Implementation
Future<void> sync() async {
await _mutationLock.synchronized(() async {
await _persistRoot();
});
}