fetchedAt method

  1. @override
DateTime? fetchedAt(
  1. String depKey
)
override

When depKey (entity.field) was last written by a server response, or null if never: hydrated snapshots, optimistic writes and manual writes carry no stamp, so they count as stale for maxAge. An elementDepKey / lengthDepKey answers for the field holding the list.

Implementation

@override
DateTime? fetchedAt(String depKey) {
  final at = _fetchedAt[depKey];
  // A field alias never ends with `]`: an element/length key, stamped
  // with the field that holds the list.
  if (at != null || !depKey.endsWith(']')) return at;
  return _fetchedAt[depKey.substring(0, depKey.lastIndexOf('['))];
}