-
Notifications
You must be signed in to change notification settings - Fork 1.6k
NSURLSession swizzling incompatible with delegate usage via NSProxy #14478
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
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
The methods that were correctly invoked through the proxy are all explicitly handled in A good starting point would probably be to add a test for the |
Thanks! I've added a unit test that tries to test that behaviour and at least the unit test passes - with a caveat that the delegate is an PTAL to see if there's something I'm missing. |
No, that looks convincing for the non-proxy case. If would be nice if proxies were supported. @liamappelbe But maybe we can work around this on our end? |
Yeah, I think it makes sense to fix the bug from both ends, if possible. I'll experiment with eliminating proxies from our bindings today. |
I added an additional unit test with an |
@tejasd are you able to reproduce it with the code Brian posted above? I've been consistently reproing it with that code. Specifically, it only hits the line |
In the PR, I suggested removing the delegate declaration, which is the only substantive difference between between my repro and the unit test. The presence of the delegate declaration may change the behavior of calls to |
Nice! FWIW, we are also working on a non-proxy solution on our side. |
Description
With
firebase_performance_instrumentation_enabled
set toNO
, the delegate method in the repro code is called. Withfirebase_performance_instrumentation_enabled
set toYES
, the delegate method is not called.It looks like the break in the call chain starts when
respondsToSelector:
is not called onReproProxy
with theURLSession:dataTask:didReceiveResponse:completionHandler:
selector.Reproducing the issue
Firebase SDK Version
13.31.2
Xcode Version
16.1
Installation Method
CocoaPods
Firebase Product(s)
Performance
Targeted Platforms
iOS
Relevant Log Output
If using Swift Package Manager, the project's Package.resolved
Expand
Package.resolved
snippetReplace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
PODS:
DEPENDENCIES:
.symlinks/plugins/cupertino_http/darwin
).symlinks/plugins/firebase_core/ios
).symlinks/plugins/firebase_performance/ios
)Flutter
).symlinks/plugins/integration_test/ios
).symlinks/plugins/objective_c/ios
)SPEC REPOS:
trunk:
- Firebase
- FirebaseABTesting
- FirebaseCore
- FirebaseCoreExtension
- FirebaseCoreInternal
- FirebaseInstallations
- FirebasePerformance
- FirebaseRemoteConfig
- FirebaseRemoteConfigInterop
- FirebaseSessions
- FirebaseSharedSwift
- GoogleDataTransport
- GoogleUtilities
- nanopb
- PromisesObjC
- PromisesSwift
EXTERNAL SOURCES:
cupertino_http:
:path: ".symlinks/plugins/cupertino_http/darwin"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
firebase_performance:
:path: ".symlinks/plugins/firebase_performance/ios"
Flutter:
:path: Flutter
integration_test:
:path: ".symlinks/plugins/integration_test/ios"
objective_c:
:path: ".symlinks/plugins/objective_c/ios"
SPEC CHECKSUMS:
cupertino_http: 94ac07f5ff090b8effa6c5e2c47871d48ab7c86c
Firebase: d80354ed7f6df5f9aca55e9eb47cc4b634735eaf
firebase_core: 6cbed78b4f298ed103a9fd034e6dbc846320480f
firebase_performance: 340bc5b09f0a38a886b6f53b2406941f3c3f3f94
FirebaseABTesting: 7d6eee42b9137541eac2610e5fea3568d956707a
FirebaseCore: 99fe0c4b44a39f37d99e6404e02009d2db5d718d
FirebaseCoreExtension: 3d3f2017a00d06e09ab4ebe065391b0bb642565e
FirebaseCoreInternal: df24ce5af28864660ecbd13596fc8dd3a8c34629
FirebaseInstallations: 6c963bd2a86aca0481eef4f48f5a4df783ae5917
FirebasePerformance: 4db21c8ac5a967d38ca8625ce77f58a7abb59bc0
FirebaseRemoteConfig: f63724461fd97f0d62f20021314b59388f3e8ef8
FirebaseRemoteConfigInterop: 98897a64aa372eac3c5b3fe2816594ccfaac55ef
FirebaseSessions: c4d40a97f88f9eaff2834d61b4fea0a522d62123
FirebaseSharedSwift: 672954eac7b141d6954fab9a32d45d6b1d922df8
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
integration_test: 4a889634ef21a45d28d50d622cf412dc6d9f586e
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
objective_c: 89e720c30d716b036faf9c9684022048eee1eee2
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
PODFILE CHECKSUM: d2243213672c3c48aae53c36642ba411a6be7309
COCOAPODS: 1.16.2
The text was updated successfully, but these errors were encountered: