-
Notifications
You must be signed in to change notification settings - Fork 378
[cupertino_http] CupertinoClient requests hang and fail to complete #1702
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
@martyfuhry What version of |
Ah, that would be great! I am only running |
OK, let me know how it goes. |
Unfortunately, the behavior persists in version |
@martyfuhry Did you ever use |
@brianquinlan downgrading to 1.5.1 solves the issue. |
It does indeed work with |
That's not good. I don't have an explanation for this regression in 2.0.2. |
Do we know what sort of callback this code path is using? The only thing I know of that could deadlock is a blocking callback. jnigen has a similar issue. If there's a reliable repro here I can investigate it and see if it'll be fixed by the fix we're working on for that. In the meantime it might be a good idea to remove blocking callbacks from cupertino_http. EDIT: Actually I guess this isn't deadlocking, but just not receiving a listener callback. |
The listener is installed here:
Presumably the request is waiting here:
I don't see a path through here that doesn't complete the future:
|
@chenfisher @martyfuhry (and possibly others): Could you tell me a bit more about the environments where you can reproduce this issue? I take it that you can only produce the issue on a physical device? Do you see this issue with |
I tried running the demo application on a real device using both
@chenfisher and @martyfuhry - could you include the output of |
I have the same problem too. It doesn't work on a physical device and also not in the simulator (iPhone 16 Pro Max). v1.5.1 helps at the moment.
|
@frank-applab Can you provide more details about the requests you make? Is it |
It's a native flutter app and I make a simple request. The follow request never complete. import 'package:dio/dio.dart';
import 'package:native_dio_adapter/native_dio_adapter.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
Dio dio = Dio();
dio.httpClientAdapter = NativeAdapter();
await dio.get('https://www.google.com');
} |
Thats for the additional information! Would it be possible for you to test a unreleased version of |
When I create a new project it works. What I've found out so far as workaround. In my case I have to remove Remove all entries from
|
|
I can reproduce this with Looking into why this is happening... |
Wow, firebase is doing some interesting things: |
Swizzling? |
Yep, our current hypothesis is that the way that delegate methods are swizzled is not compatible with the FWIW, disabling firebase performance instrumentation resolves the issue for me: |
I managed to create a pure Objective-C reproduction and filed an issue with the Firebase team: |
For what it's worth, the app I'm working on doesn't use We are using # Newer versions of native_dio_adapter use cupertino_http 2.0.0,
# which we don't want as it causes the app to hang:
# https://github.com/dart-lang/http/issues/1702#issuecomment-2616136229
# The latest version of cupertino_http that still works is 1.5.1,
# because that is still using and older, functional version of cupertino_http library.
# cupertino_http 2.0.0 was introduced to native_dio_adapter in 1.4.0,
# so we need to pin it to 1.3.0
# https://pub.dev/packages/native_dio_adapter/changelog#140
native_dio_adapter: 1.3.0 |
We updated to |
|
Thanks for the feedback! |
I've been using
IOClient
in my Flutter application. When I switched to usingCupertinoClient
, my requests fail to complete. I have inspected the network traffic from my iOS app through a proxy. The requests are being properly sent by the application and the web server is responding with the correct data. But the future fromclient.get
is never resolved in the Flutter application. No errors show up, the request simply hangs.Here is my code for initializing the
CupertinoClient
Here is an example of our code sending a request:
I've also tried using
UrlSessionConfiguration.ephemeralSessionConfiguration()
and it does not change the result. If I change the above code to returnIOClient
instead of theCupertinoClient
, the application works.Finally, it would seem that every network request hangs, not just those to my own webserver. In particular, this
get
request hangs:I do not see any errors in my console. The responses simply fail to resolve the future and the code hangs forever.
This was all tested on a physical iOS 17.6.1 device (iPhone 11 Pro Max).
The text was updated successfully, but these errors were encountered: