clearCache method

Future<void> clearCache()

Clear all local cached messages, room information and outbound group sessions and perform a new clean sync.

Implementation

Future<void> clearCache() async {
  await abortSync();
  prevBatch = null;
  rooms.clear();
  await database?.clearCache();
  encryption?.keyManager.clearOutboundGroupSessions();
  _eventsPendingDecryption.clear();
  onCacheCleared.add(true);
  // Restart the syncloop
  backgroundSync = true;
}