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

All requests are marked as Pending #212

Closed
florinmatinca opened this issue Aug 11, 2023 · 6 comments
Closed

All requests are marked as Pending #212

florinmatinca opened this issue Aug 11, 2023 · 6 comments
Labels
question Further information is requested

Comments

@florinmatinca
Copy link

Hi guys, I still have this issue on the latest version of Pulse, without using async/await.

In my APIService class, I'm just enabling the logger with :

URLSessionProxyDelegate.enableAutomaticRegistration()

Then, all the requests are appearing in the Console, but with Pending. Should I implement manually any methods from URLSessionDelegate protocol ?

Originally posted by @florinmatinca in #153 (comment)

@kean
Copy link
Owner

kean commented Nov 5, 2023

Hi, @florinmatinca. Have you found a way to resolve it?

The integration method based on URLSessionProxyDelegate only works with delegate-based URLSessions.

@kean kean added the question Further information is requested label Nov 5, 2023
@yonicsurny
Copy link

I too face this issue in my project and I do use delegate-based URLSession.

My project is quite old and is a mix of Swift and Objective-C (the networking module is in Objective-C).
I tried integrating the frameworks in a "pure Swift" and in a "Objective-C with Swift" projects and faced no issue there.

So I'm puzzled by what could be the issue in my project. Any pointers?

@yonicsurny
Copy link

Ok, my bad, I did not read attentively the other issues and pull requests on the topic. I am also using the convenience dataTask(with:completionHandler:) function which does not call the delegate.

@kean
Copy link
Owner

kean commented Aug 15, 2024

I have a potential swizzling-based solution in the works, but in the meantime, all the available options are described here. The recommended approach is to use URLSessionProxyDelegate or log the requests manually as it's the most reliable way that is unlikely to break in the future.

@yonicsurny
Copy link

Yes, I went for the following and it is working nicely.

#if !PROD
Experimental.URLSessionProxy.shared.isEnabled = true
Experimental.swizzleURLSession()
#endif

This is ok because I'm not integrating Pulse into my production build. It will only be used for debug and staging builds.

Thank you very much for your work.

@kean
Copy link
Owner

kean commented Sep 5, 2024

Closing as duplicate of #113. Fixed shiped in Pulse 5.0

@kean kean closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants