boolean resetLocalHistory(DocumentReference reference, LocalUndoRedoSnapshot snapshot) {
    for (ClientState state : getAllClientStates()) {
      PerClientLocalUndoRedoSnapshot perClientSnapshot = snapshot.getClientSnapshots().get(state.myClientId);
      if (perClientSnapshot == null) {
        perClientSnapshot = PerClientLocalUndoRedoSnapshot.Companion.empty();
      }

      boolean success = state.resetLocalHistory(reference, perClientSnapshot);
      if (!success)
        return false;
    }

    mySharedUndoStacksHolder.getStack(reference).resetTo(snapshot.getSharedUndoStack());
    mySharedRedoStacksHolder.getStack(reference).resetTo(snapshot.getSharedRedoStack());

    return true;
  }
boolean resetLocalHistory(DocumentReference reference, LocalUndoRedoSnapshot snapshot)