devtools icon indicating copy to clipboard operation
devtools copied to clipboard

why does the only method that appears is socket?

Open Renoldi opened this issue 1 year ago • 4 comments

<-- Please describe your problem here. Be sure to include repro steps. -->


DevTools version: 2.37.3 IDE: VSCode Connected Device: CPU / OS: x64 (64 bit) android Connected app type: Flutter native (debug build) Dart Version: 3.5.3 Flutter Version: 3.24.3 / stable Framework / Engine: 2663184aa7 / 36335019a8

Renoldi avatar Oct 01 '24 03:10 Renoldi

I have the same problem

LiamMarega avatar Oct 03 '24 19:10 LiamMarega

@bkonyi Was this something you fixed with https://github.com/flutter/devtools/issues/3033? Your changes were included in the 2.37.2 release, so I would have expected this to be fixed.

elliette avatar Oct 03 '24 21:10 elliette

@Renoldi Could you share a small repro with us and share whichever package you are using to send these requests? Thanks!

elliette avatar Oct 03 '24 21:10 elliette

@bkonyi Was this something you fixed with #3033? Your changes were included in the 2.37.2 release, so I would have expected this to be fixed.

This is probably WAI, but it depends on what package / library is being used to make HTTP requests. Making an HTTP request involves opening a socket, so these SOCKET entries are always expected when HTTP profiling is enabled. However, if the HTTP library being used isn't using dart:io's HttpClient underneath, those requests won't appear in the profiler.

bkonyi avatar Oct 04 '24 15:10 bkonyi

same issue with dio Screenshot 2024-10-31 at 4 54 11 AM

Flutter 3.24.4 • channel stable • https://github.com/flutter/flutter.git Framework • revision 603104015d (6 days ago) • 2024-10-24 08:01:25 -0700 Engine • revision db49896cf2 Tools • Dart 3.5.4 • DevTools 2.37.3

saeedprogrammer avatar Oct 30 '24 13:10 saeedprogrammer

@bkonyi I've have been using

  • http package v1.2.2
  • Flutter v3.24.5
  • Dart version 3.5.4
  • DevTools version 2.37.3
  • MacOS 15.1
  • Tested on Android emulator, SDK 35

All I see is SOCKET requests.

zigapovhe avatar Nov 19 '24 21:11 zigapovhe

Any updates on this still facing the issue in Flutter 3.24.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision dec2ee5c1f (3 weeks ago) • 2024-11-13 11:13:06 -0800 Engine • revision a18df97ca5 Tools • Dart 3.5.4 • DevTools 2.37.3

nicks258 avatar Dec 03 '24 10:12 nicks258

Same here on several projects, all of which using classic http package (not dio)

Nico04 avatar Dec 03 '24 10:12 Nico04

@bkonyi Was this something you fixed with #3033? Your changes were included in the 2.37.2 release, so I would have expected this to be fixed.

This is probably WAI, but it depends on what package / library is being used to make HTTP requests. Making an HTTP request involves opening a socket, so these SOCKET entries are always expected when HTTP profiling is enabled. However, if the HTTP library being used isn't using dart:io's HttpClient underneath, those requests won't appear in the profiler.

@bkonyi http package (v1.2.2) does use dart:io's HttpClient underneath, and the requests are still not shown. I even tried using cronet_http package, and its the same issue. It worked fine 2 or 3 months ago.

zigapovhe avatar Dec 04 '24 07:12 zigapovhe

how to solve this?

chiphan-quickcare avatar Dec 10 '24 06:12 chiphan-quickcare

Still facing the same issue with: Flutter 3.24.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision dec2ee5c1f (vor 4 Wochen) • 2024-11-13 11:13:06 -0800 Engine • revision a18df97ca5 Tools • Dart 3.5.4 • DevTools 2.37.3

Requests are performed using Dio 5.2.0

philitell avatar Dec 10 '24 06:12 philitell

same

This issue has been around for a long time, it seems to have been fixed with 3.24.0 before, and now it is happening again

maxfrees avatar Dec 11 '24 02:12 maxfrees

Still facing the same issue with:

Flutter 3.27.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision 8495dee1fd (2 days ago) • 2024-12-10 14:23:39 -0800 Engine • revision 83bacfc525 Tools • Dart 3.6.0 • DevTools 2.40.2

petersnoopy avatar Dec 12 '24 13:12 petersnoopy

I can confirm after upgrading Flutter to 3.27.0, the HTTP requests are now visible in the DevTools network tab. I've tried with http package, dio package and cronet_http package and all requests can be visible in the DevTools now.

• Flutter version 3.27.0 on channel stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 8495dee1fd (2 days ago), 2024-12-10 14:23:39 -0800
• Engine revision 83bacfc525
• Dart version 3.6.0
• DevTools version 2.40.2

To those still not seeing the requests after upgrading the Flutter, make sure DevTools version is 2.40.2 or higher.

zigapovhe avatar Dec 12 '24 18:12 zigapovhe

I can confirm after upgrading Flutter to 3.27.0, the HTTP requests are now visible in the DevTools network tab. I've tried with http package, dio package and cronet_http package and all requests can be visible in the DevTools now.

• Flutter version 3.27.0 on channel stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 8495dee1fd (2 days ago), 2024-12-10 14:23:39 -0800
• Engine revision 83bacfc525
• Dart version 3.6.0
• DevTools version 2.40.2

To those still not seeing the requests after upgrading the Flutter, make sure DevTools version is 2.40.2 or higher. Even if it's not 3.27.0, devtools will occasionally display http requests, and sometimes it won't display at all, showing only sockets

maxfrees avatar Dec 13 '24 01:12 maxfrees

I can confirm after upgrading Flutter to 3.27.0, the HTTP requests are now visible in the DevTools network tab. I've tried with http package, dio package and cronet_http package and all requests can be visible in the DevTools now.

I'm using 3.27.0 and DevTools 2.40.2. I tried with http and dio, but it doesn't work, it only shows SOCKET requests.

:(

Adrek avatar Dec 13 '24 21:12 Adrek

It seems to work for me now that I have deleted the cookies and website data.

petersnoopy avatar Dec 16 '24 15:12 petersnoopy

It seems to work for me now that I have deleted the cookies and website data.

I tried the same thing as you, unfortunately it didn't work. I even tried it in a newly installed browser and it didn't work: Firefox. I also tried it in the Network tab of Visual Code and the result was the same.

Adrek avatar Dec 16 '24 19:12 Adrek

Issue persists with Flutter 3.27.1, dart 3.6.0, dev tools 2.40.2. Decided to switch back to 3.22.2 stable version. Let's wait for updates, otherwise SDK conflicts are real pain.

mikegitdev avatar Jan 06 '25 09:01 mikegitdev

I realized what is causing the problem, in my case. Run a project that uses version 3.7.8 of flutter and then run one with version 3.27.0 on the same Android emulator. One solution is to cold boot the emulator when switching to the latest project. I'm using windows.

Gastongouveia avatar Jan 07 '25 02:01 Gastongouveia

Just like @Gastongouveia recommended, i cold booted my emulator on Android Studio too and the requrests showed up (using all latest versions)

kostas95 avatar Jan 07 '25 11:01 kostas95

I realized what is causing the problem, in my case. Run a project that uses version 3.7.8 of flutter and then run one with version 3.27.0 on the same Android emulator. One solution is to cold boot the emulator when switching to the latest project. I'm using windows.

я твои губы целовал

KazantsevLev avatar Jan 21 '25 11:01 KazantsevLev

Try to change emulator or build on real device i fixed the problème with this solutions.

KarimMok avatar Feb 02 '25 10:02 KarimMok

https://github.com/flutter/devtools/issues/8798 , issue still persists even after using a new emulator and cold booting it everytime , actually it is an inconsistent bug , ie it sometimes work but most of the times shows only socket , also before doing flutter upgrade it use to work perfectly .

nishantpuri10 avatar Feb 06 '25 07:02 nishantpuri10

Without the details requested here and here, we cannot answer further. Ben's answer is probably the answer.

srawlins avatar Feb 07 '25 23:02 srawlins

Without the details requested here and here, we cannot answer further. Ben's answer is probably the answer.

It's not that, because in my case I'm just using stock official http package and making basic REST requests. And it's a bit random because sometimes it works fine, with the same code, so it's quite hard to share code currently.

Nico04 avatar Feb 10 '25 09:02 Nico04

I think I've found the cause of this issue and uploaded a fix in https://github.com/flutter/devtools/pull/8860.

TL;DR: it looks like there's a possible race condition that can cause HTTP requests to be missed by DevTools, particularly when the network channel between DevTools and the target application is slow. This is likely why some users seem to encounter the issue consistently where others can't reproduce it.

I hope to land the above PR and get it cherry picked into the next stable release.

bkonyi avatar Feb 10 '25 17:02 bkonyi

Is there any method with which we can downgrade only the DevTools 2.40.2 , as it use to work perfectly in previous version ?

nishantpuri10 avatar Feb 10 '25 18:02 nishantpuri10

Is there any method with which we can downgrade only the DevTools 2.40.2 , as it use to work perfectly in previous version ?

No, the only way to downgrade DevTools versions is to downgrade your Flutter/Dart SDKs. Hopefully we can get this fix cherry picked into the upcoming stable release so the next stable version of DevTools will include the fix.

bkonyi avatar Feb 10 '25 18:02 bkonyi

Still the issue persists:

Flutter 3.27.1 • channel stable • https://github.com/flutter/flutter.git Framework • revision 17025dd882 (2 months ago) • 2024-12-17 03:23:09 +0900 Engine • revision cb4b5fff73 Tools • Dart 3.6.0 • DevTools 2.40.2

Mamasodikov avatar Feb 28 '25 05:02 Mamasodikov