devtools
devtools copied to clipboard
Cancelled requests are shown as "Pending"
Hi,
I use the dio package to make HTTP requests to our API.
Dio provided a feature for canceling requests. Under the hood it uses HttpClientRequest.abort (see here in dio's source.
However, in DevTools it shows the request as Pending:
It would be nice if it could show, that the request has been aborted.
DevTools version: 2.25.0 Connected Device: CPU / OS: arm64 (64 bit) ios Dart Version: 3.1.3 Flutter Version: 3.13.7 / stable Framework / Engine: 2f708eb839 / a794cf2681 Connected app type: Flutter native (debug build)
We should see if we get an event for abort() calls and if we do, we should mark the request as cancelled in the UI. If we do not get an event, we should see if that is something we can add in dart-io
I found the abort call that appears to be used for cancel: https://github.com/dart-lang/sdk/blob/f5fe3dddcc3401fb4848418f639a6f28187d63ce/sdk/lib/_http/http_impl.dart#L1604
I blindly tried adding _profileData?.finishRequestWithErrorto it, but wasn't able to get those events in devtools so this may require some more thought to figure out how to get the events to propagate
I'll look back into this when I get a bigger chunk of time to research
This should be fixed by https://dart-review.googlesource.com/c/sdk/+/375800