deduplicate<T> static method
Implementation
static Future<T> deduplicate<T>(
String key,
Future<T> Function() fn,
) {
if (_inflight.containsKey(key)) {
AutoPilotLogger.queue('Dedup hit → $key');
return _inflight[key]! as Future<T>;
}
final f = fn().whenComplete(() => _inflight.remove(key));
_inflight[key] = f;
return f;
}