Instabug / Instabug-iOS

In-app feedback and bug reporting tool for apps.
https://instabug.com/
Other
290 stars 67 forks source link

Network Logs not appearing when using Swift Concurrency APIs #482

Closed xmollv closed 7 months ago

xmollv commented 10 months ago

I've Integrated Instabug in a new app that's fully using Swift's Concurrency (async/await) model. I'm not being able to see the network logs being sent by my app's code (I do see the ones sent from an SDK we integrate - Socket.io). I've looked at the documentation and it states that networks logs are captured by default, but if for some reason they're not, you can enable it by passing the URLSessionConfiguration. I've done that and still they don't show up. Here's the code that does that:

Screenshot 2023-12-05 at 09 13 16

And on InstabugManager:

Screenshot 2023-12-05 at 09 13 24

⚠️ The DataProvider class lives in a different module. That class is part of a local SPM package, while the code that you're seeing in the screenshots lives on the main app target. Could that be the issue? To make it clearer:

  1. Instabug is integrated on the app target
  2. The networking happens on a local SPM package

The funny thing is that I see some network logs, the ones coming from Socket.io, and that dependency resides on the local SPM package where my networking code works too, that's why the title talks about Swift's concurrency. I'm at a loss here, I've tried everything from the documentation and doesn't seem to work.

Steps to Reproduce the Problem

image

Generate a report and see how no network logs show on Instabug.

Expected Behavior

Networks logs show on Instabug.

Actual Behavior

Network logs for that session don't show on Instabug. Other network logs from other session (whatever Socket.io uses) do show up.

Instabug integration code

Screenshot 2023-12-05 at 09 21 49

SDK Version

12.3.0

iOS Version

17.1.2

Device Model

iPhone 15 Pro

xmollv commented 10 months ago

It's actually the same issue described here (sorry I didn't see that one before opening this!): https://github.com/Instabug/Instabug-iOS/issues/478.

Could somebody please take a look? The number of apps using async/await will only grow with time, so this issue will become more urgent with the pass of time!

EyadHeikal commented 9 months ago

@xmollv Thank you for reaching out. We are aware of this and we are currently investigating how we can support it. We will get back to you with an ETA as soon as possible.

xmollv commented 9 months ago

@xmollv Thank you for reaching out. We are aware of this and we are currently investigating how we can support it. We will get back to you with an ETA as soon as possible.

That's great news! For now we've been logging the requests as a cURL string on the logs, which is far from ideal. I'd love to be able to remove that workaround and use the proper network logger!

jeannustre commented 9 months ago

Hello @EyadHeikal, any ETA updates ? Thanks.

xmollv commented 7 months ago

@EyadHeikal @ahmedsalah196 any updates on this? It has become a frustrating issue on our team to not be able to inspect the request/response from the logs 😭

EyadHeikal commented 7 months ago

@xmollv @jeannustre Can you please use this build pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/support_modern_swift_concurrency_apis/12.7.0/Instabug.podspec' ? You should be able to see these requests captured.

xmollv commented 7 months ago

@xmollv @jeannustre Can you use this build pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/support_modern_swift_concurrency_apis/12.7.0/Instabug.podspec' ?

@EyadHeikal happy to try it, but we don't use Cocoapods anymore. Any chance to have it via SPM? We currently point to https://github.com/Instabug/Instabug-SP and we're using 12.7.0 👀

EyadHeikal commented 7 months ago

@xmollv You can integrate it now using this branch support_modern_swift_concurrency_apis_spm. Note: You should be able to see all request data on the dashboard without the response body.

xmollv commented 7 months ago

@xmollv You can integrate it now using this branch support_modern_swift_concurrency_apis_spm. Note: You should be able to see all request data on the dashboard without the response body.

@EyadHeikal I've just tested it and seems to work as expected, I can see the network logs as I used to see on other apps that didn't use Swift's concurrency! When can we expect the change to be included in the stable release? 🙏🏼

EyadHeikal commented 7 months ago

@xmollv It will be included in the mid-march release

xmollv commented 7 months ago

@xmollv It will be included in the mid-march release

Awesome, I'll keep an eye out. Thanks for solving it! ❤️