Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Fix crashes and memory leaks #4256

Merged
merged 11 commits into from
Sep 24, 2018
Merged

Conversation

Kaspik
Copy link
Contributor

@Kaspik Kaspik commented Jul 23, 2018

Good morning guys!

I have some improvements in AFNetowrking that I've done in November and was testing on our app since then. I would love to switch back to CocoaPods version from our fork so I'm opening PR for these Fabric crashes here.

  • invalidateSessionCancelingTasks should also invalidate session as per name - this means the session has to be able to be allocated again not only in init method - synchronized lazy loader looks like best solution
  • session in load can be taken from sharedSession - no reason to create new one by configuration
  • getTasksWithCompletionHandler has to use weak/strong

Verified on app with almost 2 mil. active users daily since November 2017.

* master: (71 commits)
  Specify Xcode 9.4 in Travis file.
  Update AFImageDownloader.m
  Safely get mergedTasks On responseQueue
  Update HTTPBin certificates.
  Update block usage requirements.
  Fixed tests.
  Update AFAutoPurgingImageCache.m
  Preparing for the 3.2.1 release
  Fix issues with AFCompatibilityMacros.h
  Add AFCompatibilityMacros.h to podspec.
  Add new .env files for iOS 11.x
  Update SDK settings in Travis config.
  Use old SDKs to test earlier versions of iOS 11.
  Update default SDK for iOS and tvOS
  Update umbrella header.
  Update HTTPBin certificates for April 2018.
  Remove beta from 9.3 image
  Update asset catalog JSON.
  Tweak tests to send expressions directly.
  Add tests and also prohibit +new from working.
  ...

# Conflicts:
#	AFNetworking/AFNetworkReachabilityManager.h
#	AFNetworking/AFURLSessionManager.m
@Kaspik Kaspik changed the title Fix crashfixes and memory leaks Fix crashes and memory leaks Jul 23, 2018
@Kaspik
Copy link
Contributor Author

Kaspik commented Jul 23, 2018

Hey @SlaunchaMan ! This PR has some fixes that are also opened as PRs separately. As I implemented them months ago and they are verified, it would be great to get them on master and to the next release. It closes multiple PRs opened here so I believe it helps you to clean to project as well.

Let me know how does it look, thanks!

@Kaspik
Copy link
Contributor Author

Kaspik commented Jul 23, 2018

Test testRDAR17029580IsFixed is failing and I'm not sure why. ❌
It's also green locally on my machine. ✅
It's test for iOS 7 but Travis CI is not even running iOS 7 tests anymore.
Are you going to drop iOS 7 support? Should we still keep the tests there with these fixes?

@kcharwood / @nikitahils - As you implemented this fix / tests 4 years ago (#3205) - any ideas why mine changes would affect this test?

@SlaunchaMan
Copy link
Contributor

Can you explain more about the crashes you see when calling invalidateSessionCancelingTasks? A session manager manages a session; once that session is invalidated, I would expect the session manager would also need to be recreated.

@Kaspik
Copy link
Contributor Author

Kaspik commented Jul 27, 2018

@SlaunchaMan Specifically this change is memory leak fix, not crash fix.

The method invalidateSessionCancelingTasks is now also nilling the session as otherwise the session is not invalidated anytime at all and it's causing memory leak issue because session can then live even when it shouldn't.

We could probably leave the change only partially to change the session to lazy loader and nil it when it's called from other places in AFNetworking.
But in our case we tried and decided that the session can be invalidated anytime when there is nothing to do and all tasks are done and can be re-created when it's necessary to use it.

We are not seeing any issues since November 18th 2017 when we released our app with forked AFNetowrking and it also fixed a lot of crashes on CFDictionaryGetValue that has ben reported multiple times by multiple people here (like https://github.com/AFNetworking/AFNetworking/issues/4140).

As per your comment - session manager is managing the session. It can manage the session to be nil and then allocate it again, with similar configuration, but there is no need to create the manager itself again as the configuration of the manager would be the same and static.

@SlaunchaMan
Copy link
Contributor

Can you explain more about why you're calling invalidateSessionCancelingTasks? The way the API is described implies that there should be a 1:1 relationship between sessions and session managers; are you sure the leak is the session itself and not that you’re holding on to session managers for invalidated sessions?

Kaspik added 3 commits August 13, 2018 22:34
# Conflicts:
#	AFNetworking/AFNetworkReachabilityManager.h
#	AFNetworking/AFURLSessionManager.m
# Conflicts:
#	Tests/Tests/AFURLSessionManagerTests.m
@Kaspik
Copy link
Contributor Author

Kaspik commented Aug 13, 2018

@SlaunchaMan I did some research in our app and performed some tests. It looks like the invalidate could be removed. Currently releasing to production to see if it's true or not - I'll get back to you next week about situation.

Definitely looking forward to merge this as we switched for 2 weeks back to stable last AFNetworking version on CocoaPods and our crash rate increased quite a lot.

@codecov-io
Copy link

codecov-io commented Aug 13, 2018

Codecov Report

Merging #4256 into master will decrease coverage by 0.17%.
The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4256      +/-   ##
==========================================
- Coverage   88.21%   88.04%   -0.18%     
==========================================
  Files          46       46              
  Lines        5973     5970       -3     
==========================================
- Hits         5269     5256      -13     
- Misses        704      714      +10
Impacted Files Coverage Δ
Tests/Tests/AFURLSessionManagerTests.m 81.89% <100%> (-0.35%) ⬇️
AFNetworking/AFURLSessionManager.m 70.5% <75%> (-1.2%) ⬇️
AFNetworking/AFURLSessionManager.h 85.71% <0%> (-14.29%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b892e56...3c54e1f. Read the comment docs.

@Kaspik
Copy link
Contributor Author

Kaspik commented Aug 20, 2018

@SlaunchaMan Morning! Getting back to you as I promised. So current setup of this PR looks good and is stable on our app. (2mil+ daily users)

Let me know what do you think about merging this so we can move forward ideally also with CocoaPods release.

@Kaspik
Copy link
Contributor Author

Kaspik commented Aug 24, 2018

@SlaunchaMan Jeff, you responding? What else can we do to fix these issues?

@SlaunchaMan
Copy link
Contributor

@Kaspik Sorry, been busy with my day job. If you’re not invalidating sessions any more, do you still experience situations where you need to recreate the session in the session manager?

@Kaspik
Copy link
Contributor Author

Kaspik commented Aug 28, 2018

@SlaunchaMan No worries.

Yes. The invalidate method is still called sometimes - especially if app is backgrounded for longer time or anything else - and the session can be then cleared out and created again with fresh config. Reverting back to not setting it to nil also bring back some issues on Fabric... 😒

@SlaunchaMan
Copy link
Contributor

@Kaspik That makes sense, but I’m wondering why you can’t simply recreate the session manager instead of recreating its session.

@Kaspik
Copy link
Contributor Author

Kaspik commented Aug 30, 2018

@SlaunchaMan Is there any reason for that? The manager has still the same settings and it would do the same job just with more work. Now the manager is really managing session and is taking care of that for us - not you as a person by managing the manager.

Right now it handles it self + the session where session can be invalidated (as per by name of the function) and then recreated when needed by lazy loader.

@Kaspik
Copy link
Contributor Author

Kaspik commented Sep 5, 2018

Any update on merging this? If not, I'm going to switch back to our fork because crashes happening on current AFNetworking library are pretty bad (as you can see, it started when we switched back to no-fork version) - http://crashes.to/s/6daea4ae313

@SlaunchaMan
Copy link
Contributor

@Kaspik I think it’ll be OK to make this change. We should try to restrict this PR to making that one change—that is, allowing a session manager to recreate its session. I’ll make some more PR comments to that effect to remove some of the other stuff. Can you modify the invalidateSessionCancelingTasks method to take another BOOL parameter, something like recreateSession, and have that control whether or not the session is recreated? The implementation of invalidateSessionCancelingTasks would then call this new method with that parameter set to NO, so the behavior won’t change for existing code.

Copy link
Contributor

@SlaunchaMan SlaunchaMan left a comment

Choose a reason for hiding this comment

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

With these changes and my previous comment, I think we’d be good to go for the next release!

@@ -404,8 +404,7 @@ + (void)load {
7) If the current class implementation of `resume` is not equal to the super class implementation of `resume` AND the current implementation of `resume` is not equal to the original implementation of `af_resume`, THEN swizzle the methods
8) Set the current class to the super class, and repeat steps 3-8
*/
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration];
NSURLSession * session = [NSURLSession sessionWithConfiguration:configuration];
NSURLSession * session = [NSURLSession sharedSession];
Copy link
Contributor

Choose a reason for hiding this comment

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

Using the ephemeral session configuration here prevents some side effects that might happen on the shared session. Let’s leave this as it is. As we move to new Xcode versions, I suspect this code may be unnecessary, so it’ll probably be removed anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh yes, let's just move out of iOS 7 and clean the whole code. 😄

@@ -425,7 +424,6 @@ + (void)load {
}

[localDataTask cancel];
[session finishTasksAndInvalidate];
Copy link
Contributor

Choose a reason for hiding this comment

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

As we revert the above code, this should be reverted too.

@@ -556,6 +555,19 @@ - (void)dealloc {

#pragma mark -

- (NSURLSession *)session {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of making a new getter that automatically creates the session, let’s make a new intiializeSession method that creates the session with the saved session configuration and delegate queue, and call it from the initializer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm, let's think about this one. I can change the setter in invalidateSessionCancelingTasks to nil session only if user wants, but I would love to leave the lazy loader here for two reasons:

  1. Lazy loader makes sure that if we nil the session, it get's recreated again and the behavior doesn't change
  2. it fixes bug on iOS that you mentioned below - let's take a look on the test: // iOS 7 has a bug that may return nil for a session. To simulate that, nil out the session and it will return nil itself - this is wrong approach I think. If iOS 7 has bug where it can return nil, we should fix this bug by having lazy loader and not have the session nil at all - ever. So this is like 2 in 1 fix of initialize method + iOS 7 bug fix. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, actually that would work. Since the default, current behavior wouldn’t nil out the session, the lazy loader wouldn’t affect existing users. Then we could clean up all of that documentation about the iOS 7 bug!

@@ -717,6 +729,7 @@ - (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks {
} else {
[self.session finishTasksAndInvalidate];
}
self.session = nil;
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of setting the session to nil, to preserve existing behavior, let’s only recreate the session if the user explicitly passes YES to a new method that takes an additional parameter.

// iOS 7 has a bug that may return nil for a session. To simulate that, nil out the
// session and it will return nil itself.
- (void)testFileUploadTaskReturnsNilWithBug {
- (void)testSessionRecreatesAgain {
Copy link
Contributor

Choose a reason for hiding this comment

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

When the other changes happen, let’s test the existing invalidation behavior as well as new invalidation behavior.

@@ -533,17 +529,20 @@ - (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)config
self.lock = [[NSLock alloc] init];
self.lock.name = AFURLSessionManagerLockName;

__weak typeof(self) weakSelf = self;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is likely unnecessary; the getTasksWithCompletionHandler method is short-lived, and we probably want to keep the session manager around until it ends.

Copy link
Contributor Author

@Kaspik Kaspik Sep 11, 2018

Choose a reason for hiding this comment

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

Because we are then assigning it to __strong, it explicitly holds the manager around until it ends (if we would use only __weak, then you are right and we would lose the manager). Without this change - self is deallocated during the enumeration and memory leaks appear.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, I mean we could just use self inside the completion handler without fear. The completion handler is only going to maintain a strong reference to self while it’s executing; once it’s done, then that reference goes away. So we don’t need to do the __weak/__strong dance because this isn’t a retain cycle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mmm, I still think there is problem with keeping self inside the closure and there is retain cycle. If it doesn't hurt, I would love to leave it there. :)

@SlaunchaMan SlaunchaMan added this to the 3.3.0 milestone Sep 8, 2018
@Kaspik
Copy link
Contributor Author

Kaspik commented Sep 11, 2018

@SlaunchaMan Responded, updated, added more tests, updated existing ones!

@Kaspik
Copy link
Contributor Author

Kaspik commented Sep 11, 2018

screenshot 2018-09-11 at 13 27 59
Okay, I have no idea what's going on there on Travis, but tests succeeded locally and I'm not gonna be fixing something that is not broken at all. 😄

@Kaspik
Copy link
Contributor Author

Kaspik commented Sep 11, 2018

@SlaunchaMan Okay, what are we gonna do about the tests to finish this up? I think we handled all comments.

@SlaunchaMan SlaunchaMan merged commit 1bd73c7 into AFNetworking:master Sep 24, 2018
ElfSundae added a commit to ElfSundae/AFNetworking that referenced this pull request Apr 2, 2020
commit eabbf6c
Author: Elf Sundae <elf.sundae@gmail.com>
Date:   Wed Apr 1 07:29:42 2020 +0800

    Update CHANGELOG.md (AFNetworking#4537)

commit 9e9732d
Author: Elf Sundae <elf.sundae@gmail.com>
Date:   Wed Apr 1 01:53:05 2020 +0800

    Fix UIKit+AFNetworking.h (AFNetworking#4536)

commit 7ae82a2
Author: Elf Sundae <elf.sundae@gmail.com>
Date:   Wed Apr 1 00:50:45 2020 +0800

    Remove unused UIImage+AFNetworking.h (AFNetworking#4535)

commit 8052913
Author: Elf Sundae <elf.sundae@gmail.com>
Date:   Tue Mar 31 04:05:59 2020 +0800

    Separate bundle identifier for watchOS target (AFNetworking#4533)

commit 71951aa
Author: Elf Sundae <elf.sundae@gmail.com>
Date:   Tue Mar 31 03:22:06 2020 +0800

    Fix MobileCoreServices renamed warning, close #4520 (AFNetworking#4532)

commit c80dd79
Author: Elf Sundae <elf.sundae@gmail.com>
Date:   Tue Mar 31 02:04:25 2020 +0800

    Add FOUNDATION_EXPORT for AFJSONObjectByRemovingKeysWithNullValues (AFNetworking#4529)

commit 16f9a8c
Author: Jakub Kašpar <kaspikk@gmail.com>
Date:   Mon Mar 30 19:58:53 2020 +0200

    (Infra) Make infra changes to cleanup project and simplify its maintenance (AFNetworking#4531)

    * Update readme, add stale bot, add issue template, add pull request template

    * Update copy from Alamofire

commit 03a9156
Author: Elf Sundae <elf.sundae@gmail.com>
Date:   Mon Mar 30 11:38:32 2020 +0800

    Improve podspec (AFNetworking#4528)

    * Remove submodules, requires_arc

    * Removed redundant public_header_files

    * Fixed bundle identifier for CocoaPods generated framework

    * Remove prefix_header_contents attribute

commit 6ec99c9
Author: Jon Shier <jon@jonshier.com>
Date:   Sun Mar 29 16:48:58 2020 -0400

    Prepare 4.0.0. (AFNetworking#4527)

commit c9d0684
Author: Jon Shier <jon@jonshier.com>
Date:   Sun Mar 29 15:37:57 2020 -0400

    AFNetworking 4 (AFNetworking#4523)

    * Work towards 4.0.0 release.

    * Drop macOS deployment to 10.10.

    * Reduce pod requirement to 10.10.

    * Remove iOS 7 & 8 workaround.

    * Fix misspelling.

    * Remove now unnecessary version check.

    * Fixes after master merge.

    * Remove unnecessary services import.

    * Updates for travis config.

    * Year 2020 (AFNetworking#4524)

    * Add Swift package.

    * Try to fix Travis configs.

    * Explicitly set Xcode versions.

    * Try to fix Xcode selection.

    * Directly call xcversion.

    * Revert to Xcode 11.3.

    * Remove defaults.

    * Manually set schemes?

    * Don’t build examples.

    * Use updated Fastfile.

    * Properly load from macos

    * Ignore SecTrustEvaluate deprecations to fix test failures.

    * Use deprecated API for tests.

    * Add Catalyst testing.

    * Scheme updates; can’t test Catalyst until Travis has Catalina.

    * Remove deprecated APIs.

    * remove useless api for upload task (AFNetworking#4525)

    * remove unnecessary __block (AFNetworking#4526)

    * Add GitHub actions, remove Travis.

    * Update action name.

    * Remove matrixes.

    * Move build action to GitHub actions.

    Co-authored-by: Elf Sundae <elf.sundae@gmail.com>
    Co-authored-by: Kinarobin <kinarobin@outlook.com>

commit e24d494
Author: Will Han <xingheng907@hotmail.com>
Date:   Sat Mar 28 01:12:14 2020 +0800

    Post a notification when finishing moving the downloaded file successfully. (AFNetworking#4393)

    * Post a notification when finishing moving the downloaded file successfully.

    * Add test cases for move notifications.

commit c4d8f62
Author: Cédric Luthi <cedric.luthi@gmail.com>
Date:   Fri Mar 27 16:39:01 2020 +0100

    Pinning failure better error (AFNetworking#3425)

    * Error code on pinning failure must be meaningful

    `NSURLErrorServerCertificateUntrusted` instead of `NSURLErrorCancelled`

    * Remove unneeded __block qualifier

    * Add warnings about implementing an authentication challenge block

    * Simpler session-level authentication request handling

    Handle session-level authentication requests exclusively through user-provided `sessionDidReceiveAuthenticationChallenge` block. When `sessionDidReceiveAuthenticationChallenge` is not set, go through the `URLSession:task:didReceiveChallenge:completionHandler:` delegate method instead.

    * Precise error when the server trust is invalid

    Fixes #3165

    * Better server trust error with userInfo dictionary

    * Simplify code flow

    * Better setSessionDidReceiveAuthenticationChallengeBlock: documentation

    * Do not completely bypass the security policy

    Let the possibility to the `taskDidReceiveAuthenticationChallenge` block to fallback to security policy evaluation by returning `NSURLSessionAuthChallengePerformDefaultHandling`.

    * Better expectation descriptions for invalid server trust tests

    * Rename ServerTrustErrorKey into AuthenticationChallengeErrorKey

    * New authentication challenge hander block

    Deprecate `setTaskDidReceiveAuthenticationChallengeBlock:` in favor of the new `setAuthenticationChallengeHandler:` method.

    The new challenge handler allows
    * The user to handle the completion handler themself (fixes #2520)
    * The security policy to be evaluated
    * Aborting the connection with a proper error (see also #3165)

    * Fix nullability annotation

    * Throw if the authentication challenge handler returns an invalid value

    * Document -[AFURLSessionManager setAuthenticationChallengeHandler:]

commit a1f208b
Author: Kinarobin <kinarobin@outlook.com>
Date:   Fri Mar 27 12:45:58 2020 +0800

    Optimizing cancel image download and let task to be canceled really. (AFNetworking#4407)

    * optimizing cancel image download task

    * update test case

commit a5a9436
Author: Sergio Martins Pereira <s@x42.io>
Date:   Fri Mar 27 05:22:59 2020 +0100

    Change dataTaskWithHTTPMethod visibility to public (AFNetworking#4007)

    Change -dataTaskWithHTTPMethod visibility from private to public.

    Co-authored-by: Sergio M. Pereira <martins-p-sergio@users.noreply.github.com>

commit 67f558f
Author: Kinarobin <kinarobin@outlook.com>
Date:   Fri Mar 27 12:08:49 2020 +0800

    Delete unused `af_url_session_manager_creation_queue ` when don’t support below iOS 8 (AFNetworking#4401)

    * Delete unused queue when iOS deployment had changed

    * Remove unrelated test code when iOS8+

commit 3f2e551
Author: Kinarobin <kinarobin@outlook.com>
Date:   Fri Mar 27 09:20:47 2020 +0800

    Fix `NetworkActivityIndicator` kvo call back will trigger twice bug. (AFNetworking#4406)

    * remove manual KVO in `AFNetworkActivityIndicatorManager`

    * unified code style

    * add a test case for KVO

commit f484fdc
Author: Tiago Janela <tjanela@blissapplications.com>
Date:   Thu Mar 26 21:10:21 2020 -0400

    Feature/wk web view (AFNetworking#4439)

    * Removed UIWebView in favor of WKWebView

    Since UIWebView is deprecated and will be rejected soon by Apple i've removed all references to UIWebView and implemented the WKWebView extension

    * Fixed one last reference

    * Added WKNavigation to LoadRequest calls

    - WKNavigation is needed to call didFinishNavigation and didStartProvisionalNavigation
    - Fixed testcases (not sure if this is the right way?)

    * Added correct Copyright stuffs

    * Updated podsubspec UIKit iOS deployment target to 9.0

    * Updated test progressIsSet by using a large download URL request.

    * XCTFailing and fulfilling in error cases of AFWKWebViewTests

    * Adopted WKNavigationDelegate protocol on AFWKWebViewTetsts

    * Revert "Updated podsubspec UIKit iOS deployment target to 9.0"

    This reverts commit 4a4013a.

    Co-authored-by: Sebastiaan <s.seegers@sping.nl>

commit 92bb7dd
Author: Raphael Cohen <raphael.cohen@gmail.com>
Date:   Fri Mar 27 03:45:08 2020 +0300

    use cocoapods cdn instead of github as source (AFNetworking#4515)

    see here for more info: https://blog.cocoapods.org/CocoaPods-1.7.2/

commit 9c07ac0
Author: Elf Sundae <elf.sundae@gmail.com>
Date:   Fri Mar 27 08:43:45 2020 +0800

    Fix API availability warnings for NSURLSessionTaskMetrics (AFNetworking#4516)

    * Fix API availability warnings for NSURLSessionTaskMetrics

    * Fix API availability warnings for NSURLSessionTaskMetrics

commit 555385d
Author: WELCommand <shilong@ai-t.com.cn>
Date:   Sun Jan 5 08:34:04 2020 +0800

    Fix associated object bug in UIKit extensions (AFNetworking#3872)

commit 2da270b
Author: Cédric Luthi <cedric.luthi@gmail.com>
Date:   Sun Jan 5 01:26:41 2020 +0100

    Search for default pinned certificates in the main bundle (AFNetworking#3752)

    Using `[NSBundle bundleForClass:[self class]]` is dangerous because the code will behave differently depending on how AFNetworking is integrated.

    * If it is integrated as a static library (for example using CocoaPods), certificates will be searched in the main bundle.

    * If it is integrated as a framework (for example using Carthage), certificates will be searched in the AFNetworking framework.

    Even though this behavior is documented, this is dangerous. Using the main bundle makes the behavior deterministic.

    Fixes #3575

commit 0fba527
Author: svoit <1726513+svoit@users.noreply.github.com>
Date:   Sun Jan 5 01:19:31 2020 +0100

    Fix reference cycle in example, remove unnecessary weak / strong (AFNetworking#4196)

    * Fixed memory leak issues

    * Fixed memory leak issues

    * Fixed crash

commit 4743faa
Author: Bofei Zhu <bofei.zhu@healthtap.com>
Date:   Sat Jan 4 15:26:32 2020 -0800

    Fix travis CI build (AFNetworking#4472)

    * Update .travis.yml

    * Update .travis.yml

    * Update .travis.yml

    * Update .travis.yml

    * Update .travis.yml

    * update fastlane settings

    * nit

    * fix tvos

    * Update AFTestCase.m

    * revert timeout

    * Update AFUIWebViewTests.m

    * Update .env.ios12_xcode10

commit eb9ce0e
Author: Chris Streeter <streeter@users.noreply.github.com>
Date:   Sat Jan 4 15:24:33 2020 -0800

    Use dispatch_barrier_sync (AFNetworking#4474)

    This should hopefully avoid any problems where we attempt to write an
    HTTP header to a deallocated header dictionary.

    See AFNetworking#3891
    See https://github.com/AFNetworking/AFNetworking/issues/3636
    Modified from tmm1@32760e7

    Fixes AFNetworking#1391

commit 5cf601c
Author: Tiago Janela <tjanela@gmail.com>
Date:   Sat Oct 26 18:34:47 2019 -0400

    Updated SSL Pinning Test Assets (AFNetworking#4463)

commit 006e896
Author: yehuanwen <yehuanwen@126.com>
Date:   Mon Oct 21 11:23:30 2019 +0800

    Fix typeof (AFNetworking#3912)

commit 9dcc6ef
Author: Gavin King <ghking13@gmail.com>
Date:   Sun Oct 20 23:02:35 2019 -0400

    adding tvOS user agent information (AFNetworking#4014)

commit 2c2d2c3
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Sun Oct 20 22:39:56 2019 -0400

    Update code coverage settings (AFNetworking#4201)

    * Ignore coverage of test code.

    * Add a second code coverage lane.

    * Increase testing for code coverage.

    * Fix the name of the Apple TV simulator.

    * Delete .env.osx_10.10_xcode6

    * Delete .env.osx_10.9_xcode6

commit 7383ffc
Author: Mars Lan <mars.th.lan@gmail.com>
Date:   Sun Oct 20 19:00:32 2019 -0700

    Fix CHANGELOG Styling (AFNetworking#4460)

commit 023cec7
Author: Elf Sundae <elf.sundae@gmail.com>
Date:   Mon Oct 21 09:53:18 2019 +0800

    Fix NSSecureCoding (AFNetworking#4409)

    * Fix type for decoding object

    * Fix encoding numeric

commit 685e31a
Merge: ee95094 b3c4a78
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Fri Mar 1 14:00:35 2019 -0500

    Merge pull request AFNetworking#4365 from classdojo/cd-master

    Fix podspec #trivial #important

commit b3c4a78
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Fri Mar 1 16:23:33 2019 +0100

    Fix podspec as pod version supports iOS 8+ but podspec says iOS 7+

commit ee95094
Merge: 9cc7829 d6db830
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Sat Feb 9 13:18:38 2019 -0500

    Merge pull request AFNetworking#4200 from svoit/code_cleaning

    Code cleaning

commit 9cc7829
Merge: 5890adc 3517a1d
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Sat Feb 9 13:11:50 2019 -0500

    Merge pull request AFNetworking#4357 from AFNetworking/update-httpbin-certificates-april-2019

    Update HTTPBin certificates in tests

commit 3517a1d
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Sat Feb 9 11:38:10 2019 -0500

    Update HTTPBin certificates

commit 5890adc
Merge: 27608c9 ba42389
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Sun Oct 14 10:20:46 2018 -0400

    Merge pull request AFNetworking#4298 from AFNetworking/update-httpbin-certificates-december-2018

    Update HTTPBin certificates, good through December 2018.

commit ba42389
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Wed Oct 10 23:02:34 2018 -0400

    Update HTTPBin certificates, good through December 2018.

commit d6db830
Merge: e6c674e 27608c9
Author: svoit <1726513+svoit@users.noreply.github.com>
Date:   Mon Oct 8 23:28:53 2018 +0200

    Merge branch 'master' into code_cleaning

    * master: (61 commits)
      Update Travis config for Xcode 10.
      Add test for object posting notification
      update README.md, the old "Foundation URL Loading System" link is 404
      Change test name to correct one
      Change default teardown methods to tests
      Update tests to use new API
      Update PR feedback, add more tests
      Add test
      remove temporary method that could be doing nothing
      Update HTTPBin certificates.
      Chinese CONTRIBUTING.md translate
      Delete CONTRIBUTING_CH.md
      Chinese Contributing.md translate
      rollback method 'AFPostReachabilityStatusChange'
      Use AFNetworkReachabilityManager to compare  consistency of notification posts and gets, instead of SCNetworkReachabilityRef. And test case reference.
      Remove test that is nilling session manually as it's not possible anymore to not have valid session (correctly)
      Add tests for  verifing reachability manager consistence  for notification posting and getting
      Specify Xcode 9.4 in Travis file.
      Update AFImageDownloader.m
      Add an ability that notification-observer know which reachability its belong
      ...

commit 27608c9
Merge: 1bd73c7 7b48feb
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Tue Oct 2 12:10:55 2018 -0400

    Merge pull request AFNetworking#4081 from MapaX/master

    Fixed CLANG_ENABLE_CODE_COVERAGE flag so release can be made

commit 1bd73c7
Merge: 59e92b1 9bb8ea7
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Mon Sep 24 14:00:21 2018 -0400

    Merge pull request AFNetworking#4256 from classdojo/cd-master

    Fix crashes and memory leaks

commit 59e92b1
Merge: 99cda82 fdbec01
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Mon Sep 24 13:24:04 2018 -0400

    Merge pull request AFNetworking#4293 from AFNetworking/xcode-10

    Update Travis config for Xcode 10.

commit fdbec01
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Mon Sep 24 12:35:04 2018 -0400

    Update Travis config for Xcode 10.

commit 99cda82
Merge: e46e64c 23a6f44
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Mon Sep 24 12:27:48 2018 -0400

    Merge pull request AFNetworking#4286 from rob2468/master

    update README.md, the old "Foundation URL Loading System" link is 404

commit e46e64c
Merge: 390e8fa dea4316
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Fri Sep 21 16:16:33 2018 -0400

    Merge pull request AFNetworking#4248 from LMsgSendNilSelf/#4247

    Add an ability that notification-observer know which reachability it belongs

commit 390e8fa
Merge: b892e56 5b92ed3
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Fri Sep 21 15:41:04 2018 -0400

    Merge pull request AFNetworking#4262 from jin940/master

    Chinese version for CONTRIBUTING.md

commit dea4316
Author: wangpeng <wangpeng@kuaishou.com>
Date:   Thu Sep 20 16:15:30 2018 +0800

    Add test for object posting notification

commit 23a6f44
Author: jam.chenjun <jam.chenjun@gmail.com>
Date:   Tue Sep 18 15:00:32 2018 +0800

    update README.md, the old "Foundation URL Loading System" link is 404

commit 9bb8ea7
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Thu Sep 13 10:56:00 2018 -0700

    Change test name to correct one

commit af23240
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Tue Sep 11 12:58:25 2018 -0700

    Change default teardown methods to tests

commit 0579f71
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Tue Sep 11 12:20:21 2018 -0700

    Update tests to use new API

commit 864c8d6
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Tue Sep 11 12:15:01 2018 -0700

    Update PR feedback, add more tests

commit 7b48feb
Merge: d8f45e7 b892e56
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Sat Sep 8 11:54:27 2018 -0400

    Merge branch 'master' into master

commit 3c54e1f
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Tue Aug 14 08:52:28 2018 +0200

    Add test

commit a8758d2
Merge: 86c8cc2 6479536
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Mon Aug 13 22:44:03 2018 +0200

    Merge branch 'master' into cd-master

    # Conflicts:
    #	Tests/Tests/AFURLSessionManagerTests.m

commit 6479536
Merge: c976cf3 b892e56
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Mon Aug 13 22:42:56 2018 +0200

    Merge remote-tracking branch 'as_origin/master'

    # Conflicts:
    #	AFNetworking/AFNetworkReachabilityManager.h
    #	AFNetworking/AFURLSessionManager.m

commit 86c8cc2
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Mon Aug 13 22:34:41 2018 +0200

    remove temporary method that could be doing nothing

commit b892e56
Merge: a24b489 12088d6
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Wed Aug 8 16:46:47 2018 -0400

    Merge pull request AFNetworking#4269 from AFNetworking/update-httpbin-certificates-october-2018

    Update HTTPBin certificates, valid through October 2018.

commit 12088d6
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Wed Aug 8 14:23:40 2018 -0400

    Update HTTPBin certificates.

commit a24b489
Merge: a101152 5e19a4d
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Tue Jul 31 00:05:58 2018 -0400

    Merge pull request AFNetworking#4113 from stnslw/headers-per-request

    Support for setting headers per request when using AFHTTPSessionManager.

commit a101152
Merge: 7642bcf 1d1c024
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Mon Jul 30 23:47:01 2018 -0400

    Merge pull request AFNetworking#4237 from Caelink/master

    Implement two ways to collect NSURLSessionTaskMetrics

commit 5b92ed3
Author: jin940 <chanwenghong48@hotmail.com>
Date:   Sun Jul 29 01:07:45 2018 +0800

    Chinese CONTRIBUTING.md translate

    Chinese CONTRIBUTING.md translate

commit 17edb81
Author: jin940 <chanwenghong48@hotmail.com>
Date:   Sun Jul 29 01:06:01 2018 +0800

    Delete CONTRIBUTING_CH.md

commit 7ff008b
Author: jin940 <chanwenghong48@hotmail.com>
Date:   Sun Jul 29 01:00:38 2018 +0800

    Chinese Contributing.md translate

    Chinese Contributing.md translate

commit 619a65b
Author: wangpeng <wangpeng@kuaishou.com>
Date:   Wed Jul 25 22:00:31 2018 +0800

    rollback method 'AFPostReachabilityStatusChange'

commit 91cc666
Author: wangpeng <wangpeng@kuaishou.com>
Date:   Wed Jul 25 21:48:31 2018 +0800

    Use AFNetworkReachabilityManager to compare  consistency of notification posts and gets, instead of SCNetworkReachabilityRef.
    And test case reference.

commit 926d4db
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Mon Jul 23 12:20:10 2018 +0200

    Remove test that is nilling session manually as it's not possible anymore to not have valid session (correctly)

commit 5544ef0
Merge: c976cf3 7642bcf
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Mon Jul 23 11:15:48 2018 +0200

    Merge branch 'master' into cd-master

    * master: (71 commits)
      Specify Xcode 9.4 in Travis file.
      Update AFImageDownloader.m
      Safely get mergedTasks On responseQueue
      Update HTTPBin certificates.
      Update block usage requirements.
      Fixed tests.
      Update AFAutoPurgingImageCache.m
      Preparing for the 3.2.1 release
      Fix issues with AFCompatibilityMacros.h
      Add AFCompatibilityMacros.h to podspec.
      Add new .env files for iOS 11.x
      Update SDK settings in Travis config.
      Use old SDKs to test earlier versions of iOS 11.
      Update default SDK for iOS and tvOS
      Update umbrella header.
      Update HTTPBin certificates for April 2018.
      Remove beta from 9.3 image
      Update asset catalog JSON.
      Tweak tests to send expressions directly.
      Add tests and also prohibit +new from working.
      ...

    # Conflicts:
    #	AFNetworking/AFNetworkReachabilityManager.h
    #	AFNetworking/AFURLSessionManager.m

commit ffbcabe
Author: wangpeng <wangpeng@kuaishou.com>
Date:   Sun Jul 15 15:51:03 2018 +0800

    Add tests for  verifing reachability manager consistence  for notification posting and getting

commit 7642bcf
Merge: d135b74 9c2742c
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Fri Jul 13 18:04:45 2018 -0400

    Merge pull request AFNetworking#4249 from AFNetworking/xcode-9.4

    Update Travis settings for Xcode 9.4

commit 9c2742c
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Fri Jul 13 17:19:50 2018 -0400

    Specify Xcode 9.4 in Travis file.

commit 5fe5ea3
Merge: 849dff7 d135b74
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Fri Jul 13 17:09:18 2018 -0400

    Merge branch 'master' into pr/4051

commit d135b74
Merge: 009e3bb 342653f
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Fri Jul 13 15:16:47 2018 -0400

    Merge pull request AFNetworking#4246 from bbeversdorf/master

    Safely get mergedTasks On responseQueue

commit 342653f
Author: bbeversdorf <bbeversdorf@users.noreply.github.com>
Date:   Fri Jul 13 10:15:08 2018 -0500

    Update AFImageDownloader.m

commit 06079ad
Author: wangpeng <wangpeng@kuaishou.com>
Date:   Fri Jul 13 18:33:01 2018 +0800

    Add an ability that notification-observer know which reachability its belong

commit 1c52c76
Author: Brian Beversdorf <bbeversdorf@gowithfloat.com>
Date:   Thu Jul 12 16:09:29 2018 -0500

    Safely get mergedTasks On responseQueue

    There is a race condition in -[AFImageDownloader downloadImageForURLRequest:withReceiptID:success:failure:] that can cause a crash.

    #3876
    #3984

commit 1d1c024
Author: Caelin Jackson-King <caelin@yelp.com>
Date:   Mon Jul 2 17:00:18 2018 -0700

    Replace the version numbers with raw values

commit ca380fd
Author: Caelin Jackson-King <caelin@yelp.com>
Date:   Fri Jun 29 16:50:35 2018 -0700

    Inverted preprocessor logic to check iff version exists in target

commit 54f1135
Author: Caelin Jackson-King <caelin@yelp.com>
Date:   Fri Jun 29 15:25:26 2018 -0700

    Replaced preprocessor variable to make sure all valid targets allow NSURLSessionTaskMetrics

commit 6622b05
Author: Caelin Jackson-King <caelin@yelp.com>
Date:   Fri Jun 29 13:18:36 2018 -0700

    Missed one use of related type

commit 63410f3
Author: Caelin Jackson-King <caelin@yelp.com>
Date:   Fri Jun 29 11:49:55 2018 -0700

    Xcode 7.x compatibility

commit d0448a8
Merge: 009e3bb c4caddc
Author: Caelin <Caelink@users.noreply.github.com>
Date:   Fri Jun 29 10:56:08 2018 -0700

    Merge pull request #1 from Caelink/didFinishCollectingMetrics

    Implemented methods for collecting NSURLSessionTaskMetrics

commit c4caddc
Author: Caelin Jackson-King <caelin@yelp.com>
Date:   Fri Jun 29 10:50:58 2018 -0700

    Tests for notification and block use

commit aed00d3
Author: Caelin Jackson-King <caelin@yelp.com>
Date:   Thu Jun 28 16:38:16 2018 -0700

    Test for notification publishing the metrics

commit fba4f36
Author: Caelin Jackson-King <caelin@yelp.com>
Date:   Thu Jun 28 16:15:18 2018 -0700

    Added kvo use of sessionTaskMetrics

commit ad7b31f
Author: Caelin Jackson-King <caelin@yelp.com>
Date:   Thu Jun 28 13:10:43 2018 -0700

    First stab at adding a block to be called and implementing didFinishCollectingMetrics on the SessionManager

commit 009e3bb
Merge: 684dfe0 d768f1c
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Sat Jun 9 13:44:52 2018 -0700

    Merge pull request AFNetworking#4225 from AFNetworking/update-httpbin-certificates-august-2018

    Update HTTPBin certificates, valid through August 2018.

commit d768f1c
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Fri Jun 8 10:02:15 2018 -0700

    Update HTTPBin certificates.

commit 684dfe0
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Thu Jun 7 23:09:14 2018 -0700

    Update block usage requirements.

commit 41782ab
Merge: 850974c f8159fe
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Thu Jun 7 23:06:00 2018 -0700

    Merge branch 'pr/3962'

commit 850974c
Merge: 61e15f4 b158887
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Thu Jun 7 23:03:26 2018 -0700

    Merge remote-tracking branch 'origin/master'

commit 61e15f4
Merge: 48b63fa 7576300
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Thu Jun 7 22:59:25 2018 -0700

    Merge branch 'pr/4052'

commit b158887
Merge: 48b63fa 27c8195
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Thu Jun 7 22:56:28 2018 -0700

    Merge pull request AFNetworking#4002 from LeeHongHwa/fix_coding_convention

    fix space used in Objective-C method (coding style)

commit 48b63fa
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Thu Jun 7 22:50:31 2018 -0700

    Fixed tests.

commit 447d7f3
Merge: 207a707 2d19dc8
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Thu Jun 7 22:38:08 2018 -0700

    Merge branch 'pr/4088'

commit 207a707
Merge: 746f6c3 357466d
Author: Jeff Kelley <SlaunchaMan@gmail.com>
Date:   Thu Jun 7 22:33:40 2018 -0700

    Merge pull request AFNetworking#4206 from Huang-Libo/patch-1

    Update AFAutoPurgingImageCache.m

commit 357466d
Author: Huang-Libo <LiboHwang+IM@gmail.com>
Date:   Mon May 7 00:51:45 2018 +0800

    Update AFAutoPurgingImageCache.m

    NSString property should use `copy`.

commit e6c674e
Author: svoit <1726513+svoit@users.noreply.github.com>
Date:   Wed Apr 11 23:22:18 2018 +0200

    Removed redundant switch case

commit 1f70ba8
Author: svoit <1726513+svoit@users.noreply.github.com>
Date:   Tue Apr 10 23:23:46 2018 +0200

    Code cleaning

commit 2d19dc8
Author: Dan Loewenherz <dan@lionheartsw.com>
Date:   Thu Oct 26 21:39:27 2017 -0500

    use Objective-C 2.0 subscripting

commit 5e19a4d
Author: Stanisław Brzeski <stanislaw@onegini.com>
Date:   Fri Dec 15 16:31:03 2017 +0100

    Minor codestyle fix

commit ded6a76
Author: Stanisław Brzeski <stanislaw@onegini.com>
Date:   Fri Dec 15 15:54:23 2017 +0100

    Added support for setting headers per HTTP request

commit c976cf3
Author: Jakub Kaspar <kaspikk@gmail.com>
Date:   Sun Nov 12 12:20:24 2017 -0800

    fix crashes

commit d8f45e7
Author: Matti Mustonen <matti.mustonen@nordea.com>
Date:   Fri Oct 13 10:28:52 2017 +0300

    Fixed init method nullability to default value

commit 1e03fb1
Author: Matti Mustonen <matti.mustonen@nordea.com>
Date:   Thu Oct 12 13:49:40 2017 +0300

    Fixed CLANG_ENABLE_CODE_COVERAGE flag so release can be made

commit 7576300
Author: Ash Furrow <ash@ashfurrow.com>
Date:   Mon Sep 18 11:11:02 2017 -0400

    Modifies AFJSONObjectByRemovingKeysWithNullValues to remove NSArray null objects.

commit 849dff7
Author: Ash Furrow <ash@ashfurrow.com>
Date:   Mon Sep 18 10:45:40 2017 -0400

    Exposes C function prototype.

commit 27c8195
Author: leehonghwa <lyhonghwa@gmail.com>
Date:   Wed Jul 19 15:08:26 2017 +0900

    Fix asterisk location in method declaration

commit c18c09a
Author: leehonghwa <lyhonghwa@gmail.com>
Date:   Wed Jul 19 14:29:27 2017 +0900

    fix space used in Objective-C method (coding style)

commit f8159fe
Author: BKKim <BK@iMac.local>
Date:   Tue May 30 21:35:54 2017 +0900

    Fix AFURLSessionManager security weakness
    crashes when calling to a released block pointer
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants