updateStreamCache<T> method
Mirror a ZenStreamQuery's latest event into the memory cache without
spawning a background expiry timer (so widget tests using streams never
fail with pending timers; expiration is still checked lazily via isExpired).
Implementation
void updateStreamCache<T>(String cacheKey, T data, DateTime timestamp) {
final streamQuery = _streamQueries[cacheKey];
final cacheTime =
streamQuery?.config.cacheTime ?? const Duration(minutes: 5);
_cache[cacheKey]?.expiryTimer?.cancel();
_cache[cacheKey] = _CacheEntry<T>(
data: data,
timestamp: timestamp,
cacheTime: cacheTime,
);
}