-
Notifications
You must be signed in to change notification settings - Fork 340
non GET requests (PUT, POST, DELETE) requests stay with pending status and never "finish" #8509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you provide a minimal repro of the case you are talking about so that we can reproduce the issue? |
I can't right now, I'm on the road, but it's easily reproducible - basically all POST/PUT/DELETE (and I suggest GET, but empty GET wouldn't make sense so I don't have it) with empty bodies render as Pending. |
@ydolzhenko @duytq94 @JulianSchmidtZollsoft sorry for the delay. I can reproduce this, but I'd like some more details, if you can:
I suspect this is a bug in dart:io. Something like dart-lang/sdk#39548 or dart-lang/sdk#45679 or dart-lang/sdk#30842. I'm investigating in there at the moment. |
@srawlins |
Thanks! In the meantime I've developed a new theory that there is a race condition in the profiling code, in dart:io. When there is no response body, |
@srawlins , same as @JulianSchmidtZollsoft - package:http on the client and a jvm/tomcat server. |
I see indeed that Since |
…esponse Fixes flutter/devtools#8509 From my research into the bug: > I see indeed that `_HttpProfileData.finishResponse()` is called before `_HttpProfileData.startResponse()`. I think this is just a result of microtask scheduling; when the response has no body, `_incoming.dataDone` completes before `_httpRequest._responseCompleter`. > Since `startResponse` is responsible for setting `responseInProgress` to `true`, the call to `finishResponse` short circuit returns immediately. We therefore don't finish the response timeline, or log the end time, etc. The fix here does not rely on microtask organization, which I think would be fragile. Instead, we don't listen to the `dataDone` future until we've logged the start of the response. Change-Id: Ib735742b297a261e6566ae8caf9eac0d71fc8fdb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415140 Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
This should be fixed with https://dart-review.googlesource.com/c/sdk/+/415140. The fix will first appear in Dart 3.8 stable. |
Uh oh!
There was an error while loading. Please reload this page.
Basically all non-GET requests that return empty body (just 200 OK) get stuck with pending status and never end - while in fact they're working as expected.
The ones that return with any body content are being displayed fine.
DevTools version: 2.37.3
IDE: Android-Studio
Connected Device:
CPU / OS: x64 (64 bit) ios
Connected app type: Flutter native (debug build)
Dart Version: 3.5.4
Flutter Version: 3.24.4 / stable
Framework / Engine: 603104015d / db49896cf2
The text was updated successfully, but these errors were encountered: