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

Runtime warning in FPRNSURLSessionInstrument when running on iOS 17 RC built with Xcode 15 RC #11821

Closed
TAATHub opened this issue Sep 19, 2023 · 7 comments · Fixed by #11825
Closed

Comments

@TAATHub
Copy link

TAATHub commented Sep 19, 2023

Description

Similar to #11536, a runtime warning as below occurs when running on iOS 17 RC built with Xcode 15 RC.

Warning:

The request of a upload task should not contain a body or a body stream, use `upload(for:fromFile:)`, `upload(for:from:)`, or supply the body stream through the `urlSession(_:needNewBodyStreamForTask:)` delegate method.

Code:

/** Instruments -uploadTaskWithRequest:fromData:.
 *
 *  @param instrument The FPRNSURLSessionInstrument instance.
 *  @param instrumentor The FPRClassInstrumentor to add the selector instrumentor to.
 */
FOUNDATION_STATIC_INLINE
NS_EXTENSION_UNAVAILABLE("Firebase Performance is not supported for extensions.")
void InstrumentUploadTaskWithRequestFromData(FPRNSURLSessionInstrument *instrument,
                                             FPRClassInstrumentor *instrumentor) {
    ...
    NSURLSessionUploadTask *uploadTask =
        ((OriginalImp)currentIMP)(session, selector, request, bodyData); // This line causes the warning
    if (uploadTask.originalRequest) {
      FPRNetworkTrace *trace =
          [[FPRNetworkTrace alloc] initWithURLRequest:uploadTask.originalRequest];
      [trace start];
      trace.requestSize = bodyData.length;
      [trace checkpointState:FPRNetworkTraceCheckpointStateInitiated];
      [FPRNetworkTrace addNetworkTrace:trace toObject:uploadTask];
    }
    return uploadTask;
  }];
}

Reproducing the issue

Run an app and check the runtime warnings on Xcode.

Firebase SDK Version

10.9.0 (also occurred with 10.15.0)

Xcode Version

15.0 (15A240d)

Installation Method

Swift Package Manager

Firebase Product(s)

Analytics, App Distribution, Authentication, Crashlytics, DynamicLinks, Performance

Targeted Platforms

iOS

Relevant Log Output

The request of a upload task should not contain a body or a body stream, use `upload(for:fromFile:)`, `upload(for:from:)`, or supply the body stream through the `urlSession(_:needNewBodyStreamForTask:)` delegate method.

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!
@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@TAATHub
Copy link
Author

TAATHub commented Sep 19, 2023

runtime_warning

@UjjwalNepal
Copy link

Yeah same on ios 17.0

@skywalkerlw
Copy link

I can see exactly the same warning here.
App crash rating increases, not sure related to it or not.

image
@paulb777
Copy link
Member

@skywalkerlw The fix is staged for our next 10.16.0 release planned for next week.

@garethlloyd1994
Copy link

We are still seeing this warning in 10.16.0 - did the fix get released with this change?

Screenshot 2023-10-06 at 4 30 36 pm
Screenshot 2023-10-06 at 4 30 27 pm

@paulb777
Copy link
Member

paulb777 commented Oct 6, 2023

The fix got deployed in the InstrumentUploadTaskWithRequestFromData function, but it looks like the same issue is still in InstrumentUploadTaskWithStreamedRequest.

thanks for the report. We'll put this on this list for the next release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.