Skip to content

Releases: twitter/ios-twitter-network-layer

v2.17.0

10 Aug 21:14
bf6b9f3
Compare
Choose a tag to compare

2.17.0

  • Drop support for iOS 8 & 9

2.16.0

  • Replace TNLRequest class methods with C functions
    • Swift does not like having an @interface have the same name as an @protocol
    • It can work, but gets very messy
    • Best to avoid it and replace the convenient class method interfaces in Objective-C with C functions
    • Though this is a minor version bump, it is API breaking
      • There isn't a way to deprecated the old APIs and introduce new ones, we just have to remove the old ones to fix usages in Swift
      • Apologies for the inconvenience!
  • Also, update TNLHTTP.h to be much more Swift friendly

2.15.5

  • Adopt direct support for Objective-C code and eliminate PRIVATE_SELF C function pattern
    • Preserves Objective-C calling syntax for better code legibility (less C-style calls interleaving ObjC)
    • Safer than PRIVATE_SELF C functions (don't need to check self != nil)
    • Avoids awkward self->_ivar access in the direct methods (can stick with just using _ivar)
    • Same low binary overhead as private C functions

2.15.0

  • Make TNLError.h much more Swift compatible

v2.14.0

30 May 15:37
16be3da
Compare
Choose a tag to compare

2.14.0

  • Update TNLCommunicationAgent to handle reachability behavior changes
    • The Network.framwork can yield an "other" interface when VPN is enabled (on Mac binaries)
      • Coerce these into WiFi since we don't have a good way to determine the actual interface used at the moment
    • The Network.framework used to yield WiFi for any network connection on a simulator, but now yields Wired
      • Rename TNLNetworkReachabilityReachableViaWiFi to TNLNetworkReachabilityReachableViaEthernet and handle both cases as Ethernet

2.13.0

  • Refactor Service Unavailable Backoff system to be more abstract and support any trigger for backoff
    • All *serviceUnavailableBackoff* APIs are refactored into *backoff* APIs
    • Introduce [TNLGlobalConfiguration backoffSignaler]
      • Implement your own TNLBackoffSignaler to customize behavior ... or ...
      • Default will use TNLSimpleBackoffSignaler which will signal on HTTP 503

2.12.0

  • Abstract out Service Unavailable Backoff Behavior for customization to be applied
    • See [TNLGlobalConfiguration serviceUnavailableBackoffBehaviorProvider] for providing a custom backoff behavior
      • Implement your own TNLServiceUnavailableBackoffBehaviorProvider to customize behavior
      • Due to Service Unavailable signaling being opaque, only the HTTP Headers and the URL can be provided
    • Default will use TNLSimpleServiceUnavailableBackoffBehaviorProvider
      • Exact same behavior as before (introduced in TNL prior to v2.0 open sourcing)

2.11.0

  • Change the TNLURLSessionAuthChallengeCompletionBlock arguments
    • Leave the disposition parameter
    • Change the credentials parameter of NSURLCredentials to be credentialsOrCancelContext of id
      • This will permit TNLAuthenticationChallengeHandler instance to be able to cancel the challenge and provide extra context in the resulting error code
      • Twitter will use this to cancel 401 login auth challenges when we don't want a redundant request to be made (since it just yields the same response)
        • This is to facilitate working around the behavior in NSURLSession where an HTTP 401 response with WWW-Authenticate header will always be transparently be retried (even when unmodified yielding the identical 401 response).
        • An additionaly problem is that canceling the 401 response will discard the response's body. If there is information needed in the response body, it will be lost.
        • Twitter has updated its WWW-Authenticate header responses to include additional metadata since the response body cannot be used.
        • Apple Feedback: FB7697492

2.10.0

  • Add retriable dependencies to TNLRequestOperation
    • Whenever a TNLRetryPolicyProvider would yield a retry, that retry will be delayed by the longer of 2 things:
      1. The delay provided by the retry policy provider (minimum of 100 milliseconds)
      2. Waiting for all dependencies on the TNLRequestOperation to complete
      • Normally, all dependencies of a retrying TNLRequestOperation will be complete before it has started but it is now possible to add dependencies after the request operation has already started to increase the dependencies on a retry starting.

2.9.0

  • Introduce tnlcli, a command-line-interface for TNL
    • Like cURL but with TNL features
    • Verbose mode provides all TNL logging to stdout / stderr along with lots of other details

v2.7.0

06 Jun 17:37
d562a62
Compare
Choose a tag to compare
  • change computeMD5 to responseComputeHashAlgorithm
    • provides choice in what hash algo to use
  • Make TNLResponse fully support secure coding
    • Necessary for iOS 13
  • Introduce TARGET_OS_UIKITFORMAC conditional code
    • Project settings still not update for iOS on Mac support (yet)

v2.6.1

04 Jun 18:35
a508fc3
Compare
Choose a tag to compare

2.6.1

  • Fix terrible bug where cancelling all request operations for any TNLRequestOperationQueue will cancel all request operations for all queues!

2.6.0

  • Move away from mach time for metrics to NSDate instances
    • This better mirrors what Apple does
    • Avoids the pitfall of using mach times as more than just measurements of durations and using them as reference timestamps (which is frought)
    • Using NSDate now does have the problem of clock changes impacting timings, but this is so infrequent it practically won't ever affect metrics from TNL
  • Add sessionId to TNLAttemptMetaData
    • Helps keep track of what NSURLSession was used
  • Add taskResumePriority to TNLAttemptMetaData
    • Helps keep track of what QOS was used when resume was called for the underlying NSURLSessionTask
  • Add taskResumeLatency to TNLAttemptMetaData
    • Helps diagnose if there is some unforseen stall between calling resume for the task and the fetching actuallying starting
  • Add taskMetricsAfterCompletionLatency and taskWithoutMetricsCompletionLatency to TNLAttemptMetaData
    • Helps track when radar #27098270 occurs

2.5.0

  • Add [TNLGlobalConfiguration URLSessionPruneOptions]
    • These options offer ways for TNL to prune inactive internal NSURLSession instances more aggressively than the 12 session limit does
    • Options can be a combination of: on memory warning, on app background and/or after every network task
    • Callers can also provide a special option to prune now
  • Add [TNLGlobalConfiguration URLSessionInactivityThreshold]
    • Works with URLSessionPruneOptions by limiting what NSURLSession intances are inactive by requiring a duration to elapse since the last network task ran
  • Add [TNLGlobalConfiguration pruneURLSessionMatchingRequestConfiguration:operationQueueId:]
    • Offers a way to explicitely purge a specific underlying NSURLSession based on a given TNLRequestConfiguration and a TNLRequestOperationQueue instance's identifier

2.4.1

Author: Laurentiu Dascalu

  • Expose method on TNLLogger to redact desired header fields from being logged
  • Good for redacting things you don't want to log like Authorization header field

2.4.0

  • Add captive portal detection to TNLCommunicationAgent
    • detects when a known HTTP (non-HTTPS) endpoint is intercepted via a captive portal
    • this mechanism is a solid tradeoff in coverage vs complexity
      • there are many ways captive portals can manifest beyond what TNL detects
      • a 100% coverage is extremely complicated and 100% accuracy is not feasible
      • supporting the simplest mechanism for detection is sufficient for most detection use cases

v2.3.0

28 Oct 18:10
Compare
Choose a tag to compare
  • Add background upload support using HTTPBody
    • TNL will encapsulate the busy-work if there is an upload desire via an HTTPBody instead of an HTTPFilePath
  • Migrate to Xcode 10
    • Enable parallel unit tests (so much faster!)
  • Other miscellaneous minor fixes

v2.2.0

29 Aug 17:15
bf05c35
Compare
Choose a tag to compare
  • Fix buggy GZIP/DEFLATE content encoder
  • Revise TNLRetryPolicyProvider to support updating the
  • request's config on retry
  • drop iOS 7 support
  • fix race condition with UIApplication background tasks for TNL
  • clean up misc code
  • improve misc logging
  • add tvOS and watchOS support
  • fix macOS support