cancelSub method

Future<void> cancelSub()
inherited

Cancel the active subscription, awaiting the cancel. Used on sign-out so the native Firestore listener is fully torn down before the auth token is invalidated (otherwise the dying listener can fire PERMISSION_DENIED against the revoked token).

Implementation

Future<void> cancelSub() async {
  final old = sub;
  sub = null;
  if (old != null) {
    await old.cancel();
  }
}