deleteExpiredKeys method

  1. @override
Future<bool> deleteExpiredKeys()
override

Removes all expired keys. Deletes are local-only — they are NOT appended to the commit log, so an expiry sweep never advances the local commitId and never propagates to other secondaries via sync. Expiry is treated as backend maintenance, not a sync-worthy mutation; clients drop expired keys independently using their own TTL bookkeeping.

Implementation

@override
Future<bool> deleteExpiredKeys() async {
  final expired =
      (await getExpiredKeys()).asBroadcastStream(); // materialize below
  final keys = <String>[];
  await for (final k in expired) {
    keys.add(k);
  }
  for (final k in keys) {
    // Expiry deletes are local-only maintenance: purge the row and its
    // commit entry, never advance the commit id.
    await remove(k, skipCommit: true);
  }
  return true;
}