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

Google Map does not load for 3.0.0 and above #155

Closed
kushal211 opened this issue Jan 31, 2023 · 8 comments
Closed

Google Map does not load for 3.0.0 and above #155

kushal211 opened this issue Jan 31, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@kushal211
Copy link

When I used version 3.0.0 and above it does not load Google Maps.

After investigation, I found that it is the issue with the latest release when you directly use

URLSessionProxyDelegate.enableAutomaticRegistration()

The quick solution is to use version less than 3.0.0

@vovander
Copy link

vovander commented Feb 4, 2023

I have the same issue

@kean kean added the bug Something isn't working label Feb 5, 2023
@kean
Copy link
Owner

kean commented Feb 5, 2023

Hi, nothing significant changed in URLSessionProxyDelegate in Pulse 3, so I'm not sure what might be the root cause. What OS version have you tested on? Is there anything in the logs/stacktraces that indicates what the issue might be?

The only change in URLSessionProxyDelegate was removing conditional compilation from:

Screenshot 2023-02-05 at 10 02 41 AM

Can you please try removing this code entirely from the file and see if that works?

@kushal211
Copy link
Author

@kean - Thanks for the feedback.

Yes, I was surprised too when I found out this was causing the issue. I have tested in iOS 16.1, 16.2, and 16.3.

I removed URLSessionProxyDelegate integration and manually integrated using EventMonitor protocol and it's working perfectly.

Also, I did not find anything in the logs/stacktraces for this issue.

@ayuzhin
Copy link

ayuzhin commented Feb 8, 2023

Hello @kean. I confirm, GTMSessionFetcher https://cocoapods.org/pods/GoogleAPIClientForREST breaks when using URLSessionProxyDelegate.enableAutomaticRegistration(). GTMSessionFetcher is used in all google services such as maps, disk, etc.

@kean
Copy link
Owner

kean commented Feb 8, 2023

Potentially related: #141

@kean
Copy link
Owner

kean commented Feb 8, 2023

GTMSessionFetcher has a lot of code that manages session creation and delegate. Does someone have a sample project where you could integrate Pulse and debug it?

The workaround is to use a different logging method. Any of them will work, except for URLSessionProxyDelegate.enableAutomaticRegistration mentioned in the issue.

P.S. I wish there was a simple way to observe URLSession without intercepting its delegate.

@ayuzhin
Copy link

ayuzhin commented Feb 9, 2023

As requested, I provide a demo application based on reading items from Google Drive
https://github.com/ayuzhin/google-drive-demo.git

There are two buttons on the main screen:

  1. Read items from Google Drive
  2. Display Pulse console

If you do not use the URLSession global proxy using URLSessionProxyDelegate via calling URLSessionProxyDelegate.enableAutomaticRegistration(), then in the Xcode console you can see the phrase "Fetch of items from Google Drive is done."

If you uncomment the line URLSessionProxyDelegate.enableAutomaticRegistration() in the viewDidAppear method of the ViewController, then the response from the google service will never be received, and in some case it may lead to a deadlock in GTMSessionFetcher and the application hangs.

I hope this helps debug and fix a problem in your really interesting and useful library.

P. S. Yes, manual logging of network requests works, but it is not always convenient and informative, because not all modules can connect EventMonitor.

@kean kean closed this as completed in c5abec2 Feb 10, 2023
@kean
Copy link
Owner

kean commented Feb 10, 2023

I added a workaround in version 3.4.3 where URLSessionProxyDelegate.enableAutomaticRegistration skips GTMSessionFetcher. Obviously, it's less than perfect. I'm not sure what else I could do.

azone added a commit to azone/Pulse that referenced this issue Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants