lookupEventPresence method

Future<bool?> lookupEventPresence(
  1. String eventName,
  2. int tsMillis
)

Implementation

Future<bool?> lookupEventPresence(String eventName, int tsMillis) async {
  return await _lock.synchronized(() async {
    if (_memoryQueue.containsEvent(eventName, tsMillis)) {
      return true;
    }

    if (_dbAvailable) {
      final present = await _sqliteStorage.containsEvent(eventName, tsMillis);
      _syncStorageState();
      if (present != null) {
        return present;
      }
    }

    if (_pendingDeliveryReplay) {
      return false;
    }

    return null;
  });
}