Releases: twitter/ios-twitter-network-layer
Releases · twitter/ios-twitter-network-layer
v2.17.0
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!
- Swift does not like having an
- Also, update
TNLHTTP.h
to be much more Swift friendly
2.15.5
- Adopt
direct
support for Objective-C code and eliminatePRIVATE_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 checkself != 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
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
toTNLNetworkReachabilityReachableViaEthernet
and handle both cases as Ethernet
- Rename
- The
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
- Implement your own
- All
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
- Implement your own
- Default will use
TNLSimpleServiceUnavailableBackoffBehaviorProvider
- Exact same behavior as before (introduced in TNL prior to v2.0 open sourcing)
- See
2.11.0
- Change the
TNLURLSessionAuthChallengeCompletionBlock
arguments- Leave the disposition parameter
- Change the credentials parameter of
NSURLCredentials
to be credentialsOrCancelContext ofid
- 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 withWWW-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
- This is to facilitate working around the behavior in
- This will permit
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:- The delay provided by the retry policy provider (minimum of 100 milliseconds)
- Waiting for all
dependencies
on theTNLRequestOperation
to complete
- Normally, all
dependencies
of a retryingTNLRequestOperation
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.
- Whenever a
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
- change
computeMD5
toresponseComputeHashAlgorithm
- 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
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
toTNLAttemptMetaData
- Helps keep track of what
NSURLSession
was used
- Helps keep track of what
- Add
taskResumePriority
toTNLAttemptMetaData
- Helps keep track of what QOS was used when
resume
was called for the underlyingNSURLSessionTask
- Helps keep track of what QOS was used when
- Add
taskResumeLatency
toTNLAttemptMetaData
- Helps diagnose if there is some unforseen stall between calling
resume
for the task and the fetching actuallying starting
- Helps diagnose if there is some unforseen stall between calling
- Add
taskMetricsAfterCompletionLatency
andtaskWithoutMetricsCompletionLatency
toTNLAttemptMetaData
- Helps track when radar
#27098270
occurs
- Helps track when radar
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
- These options offer ways for TNL to prune inactive internal
- Add
[TNLGlobalConfiguration URLSessionInactivityThreshold]
- Works with
URLSessionPruneOptions
by limiting whatNSURLSession
intances are inactive by requiring a duration to elapse since the last network task ran
- Works with
- Add
[TNLGlobalConfiguration pruneURLSessionMatchingRequestConfiguration:operationQueueId:]
- Offers a way to explicitely purge a specific underlying
NSURLSession
based on a givenTNLRequestConfiguration
and aTNLRequestOperationQueue
instance'sidentifier
- Offers a way to explicitely purge a specific underlying
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
- Add background upload support using
HTTPBody
- TNL will encapsulate the busy-work if there is an upload desire via an
HTTPBody
instead of anHTTPFilePath
- TNL will encapsulate the busy-work if there is an upload desire via an
- Migrate to Xcode 10
- Enable parallel unit tests (so much faster!)
- Other miscellaneous minor fixes
v2.2.0
- 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