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

fix: CFNetwork upload warning setting body twice #240

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

einsteinx2
Copy link
Contributor

Summary

  • Starting with Xcode 15/iOS 17, there is a new warning in CFNetwork if you call [NSURLSession uploadTaskWithRequest:fromData:] if the request passed in already has its body set. In this case, we set the same data as the HTTPBody property of the request that we pass in to that method, so in the end the call worked fine, but now warns that we're setting it twice. Since we always set the post body on the request when we call [MPURLRequestBuilder build] on line 246, I've switched to using the more correct [NSURLSession dataTaskWithRequest] which just uses the HTTPBody from the request instead of the data we pass in. This works exactly the same, but fixes the warning.

Testing Plan

  • E2E tested using a test app

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

Copy link
Contributor

@BrandonStalnaker BrandonStalnaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@einsteinx2 einsteinx2 merged commit 0a177f9 into development Nov 29, 2023
11 checks passed
@einsteinx2 einsteinx2 deleted the fix/5921-fix-cfnetwork-upload-warning branch November 29, 2023 14:49
@mparticle-automation
Copy link
Contributor

🎉 This PR is included in version 8.17.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

mparticle-automation added a commit that referenced this pull request Nov 30, 2023
# [8.17.0](v8.16.0...v8.17.0) (2023-11-30)

### Bug Fixes

* CFNetwork upload warning setting body twice ([#240](#240)) ([0a177f9](0a177f9))

### Features

* 5343 Refactor Kit Filter Hash Functions ([#228](#228)) ([5c26a9e](5c26a9e))
* Begin Implementation MPSideloadedKit Filtering Methods ([#231](#231)) ([ad543fb](ad543fb))
* Finish Implementation of MPSideLoadedKits ([#239](#239)) ([96e62f5](96e62f5))
* Improve background batch uploading and session management ([#238](#238)) ([dc6a9cb](dc6a9cb))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants