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

Empty response for async bytes #646

Open
flejmer opened this issue Jan 12, 2023 · 10 comments
Open

Empty response for async bytes #646

flejmer opened this issue Jan 12, 2023 · 10 comments

Comments

@flejmer
Copy link

flejmer commented Jan 12, 2023

Environment

  • Platform+version: iOS 16.1.2
  • FLEX version: 5.22.10

Bug Report

I checked the FLEX networking debugger and requests that I make appear with empty response. That is not correct since I'm getting the data that is displayed on the app. I looked into similar issues mentioned in #603 and #611 but I'm not using firebase so it's not related.
I do networking using concurrency so perhaps that could be part of an issue with FLEX.
URLSession with bytes(for request: URLRequest, delegate: URLSessionTaskDelegate?) to be specific.

Mechanism in network history is listed as

NSURLSessionDataTask (delegate: _TtC10FoundationP33_1935C07EE287982D980AA89BB85ACEFA28URLSessionAsyncBytesDelegate)

Screenshot 2023-01-12 at 17 26 16

@flejmer flejmer added the bug label Jan 12, 2023
@brianplattenburg-delta
Copy link

Platform+Version: iOS 15.x, 16.2
FLEX Version: 5.22.10

I think this is an issue specific to iOS 16 with capturing the response body when using the new async interface methods of URLSession introduced in iOS 15's Foundation updates. (Not just bytes, I see it with data as well)

I am experiencing the same behavior only when using the new async interface for URLSession, specifically data(for: URLRequest, delegate: URLSessionTaskDelegate?). Any calls to the non-async interface of URLSession continue to be captured and displayed in FLEX.

In the iOS 16.2 simulator, FLEX behaves exactly as shown above in @flejmer 's post. The response body shows as empty and it shows as "Awaiting Response" in the list of requests even after the app has received and process data from this call.

The exact same code in an iOS 15.0 simulator does show responses in FLEX.

@dmhts
Copy link

dmhts commented Feb 7, 2023

I can confirm the same issue on my side.

@NSExceptional
Copy link
Collaborator

Hey! An example project would be really helpful if someone can make one :)

@pwadowski
Copy link

I can also confirm this issue. I use standard dataTask(with request:, completionHandler:) and multiple requests are marked as Awaiting Response.

@brianplattenburg-delta
Copy link

I took a quick stab at a demo project for this bug: https://github.com/brianplattenburg-delta/FLEXAsyncEmptyDemo

@burakCokyildirim
Copy link

Is there any progress for this issue?

@chuck-gnaw
Copy link

I had the same issue, empty response

@nixzhu
Copy link

nixzhu commented Mar 21, 2024

Is there any progress on this issue?

@chuck-gnaw
Copy link

I have the same issue

@NSExceptional
Copy link
Collaborator

Hi all,

I took a stab at investigating this. I think the issue is that URLSession:dataTask:didReceiveResponse:completionHandler: is not called on URLSession

At the moment, it would require more work than I can spare to figure this one out. It will possibly involve hooking a Swift function, which is a delicate process. If anyone knowledgable with this sort of thing can help or offer any insight, it would be much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants