Skip to content
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

Out-of-order callbacks received in cupertino_http #1413

Open
brianquinlan opened this issue Nov 27, 2024 · 5 comments
Open

Out-of-order callbacks received in cupertino_http #1413

brianquinlan opened this issue Nov 27, 2024 · 5 comments
Assignees
Labels
package:cupertino_http Issues related to package:cupertino_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@brianquinlan
Copy link
Collaborator

brianquinlan commented Nov 27, 2024

flutter: Null check operator used on a null value
flutter: #0      CupertinoClient._tracker (package:cupertino_http/src/cupertino_client.dart:165)
flutter: #1      CupertinoClient._onResponse (package:cupertino_http/src/cupertino_client.dart:224)
flutter: #2      URLSession.delegate.<anonymous closure> (package:cupertino_http/src/cupertino_api.dart:901)
flutter: #3      NSURLSessionDataDelegate.URLSession_dataTask_didReceiveResponse_completionHandler_.<anonymous closure>.<anonymous closure> (package:cupertino_http/src/native_cupertino_bindings.dart:65934)
flutter: #4      ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition.listener.<anonymous closure> (package:cupertino_http/src/native_cupertino_bindings.dart:60886)
flutter: #5      _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline (package:cupertino_http/src/native_cupertino_bindings.dart:60772)
flutter: #6      _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable.<anonymous closure> (package:cupertino_http/src/native_cupertino_bindings.dart)
flutter: #9      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:194)
@brianquinlan
Copy link
Collaborator Author

See dart-lang/native#1760

@jankuss
Copy link

jankuss commented Dec 3, 2024

We also observe this with version 2.0.1, when "Minimum Deployments" is set to iOS 16 for the Pods-project and the app is a release-build.
image

The future will never resolve in this example, it will always show "Waiting":

import 'package:cupertino_http/cupertino_http.dart';
import 'package:flutter/material.dart';

void main() {
  final client = CupertinoClient.defaultSessionConfiguration();
  final a = client.get(Uri.parse('https://google.de'));

  runApp(
    MaterialApp(
      title: 'Flutter Demo',
      home: Scaffold(
        body: Center(
          child: FutureBuilder(
              future: a,
              builder: (context, response) {
                if (response.connectionState == ConnectionState.waiting) {
                  return const Text('Waiting');
                }

                return const Text('Done');
              }),
        ),
      ),
    ),
  );
}

@brianquinlan
Copy link
Collaborator Author

brianquinlan commented Dec 5, 2024

@jankuss Could you reproduce this on a debug build? I cannot reproduce this on the iOS simulator.

Do you see the exact same traceback.

@jankuss
Copy link

jankuss commented Dec 9, 2024

@brianquinlan I definetly saw the same trace back last week while debugging. Today I tried again, and I could not see the message in logs anymore. Might this be another issue?

My reproduction for the issue I am experiencing is located here: https://github.com/jankuss/cupertino_http_stuck_requests

Important: It needs to be built in release mode and run on a real device

Debug builds do not run into this issue. A notable change which I did not mention explicitly yet is the following adjustment in the Podfile:

/* ... */

 post_install do |installer|
   installer.pods_project.targets.each do |target|
     flutter_additional_ios_build_settings(target)
+    target.build_configurations.each do |config|
+      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
+    end
   end
 end

Let me know if this might be related, if not I will gladly create a separate issue.

@brianquinlan brianquinlan changed the title Out-of-order callbacks received in cuperto_http Out-of-order callbacks received in cupertino_http Dec 9, 2024
@brianquinlan
Copy link
Collaborator Author

Let me know if this might be related, if not I will gladly create a separate issue.

I think that the issue is related and I'm looking into it. It might take a while to sort this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:cupertino_http Issues related to package:cupertino_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants