removeInFlight method
Removes an in-flight request only while owner still owns key.
A newer take-latest request may replace the entry before an older request's completion callback runs. Comparing the future by identity prevents that older callback from deleting the newer active request.
Implementation
bool removeInFlight(String key, Future<Response> owner) {
final current = _inFlightRequests[key];
if (current == null || !identical(current.$1, owner)) return false;
_inFlightRequests.remove(key);
return true;
}