Implements the RequestCache to persist failed requests. It uses Storage to handle reading and writing to a file and CodableRequestContainer to make an array of existentials encodable and decodable. It works by encoding each underlying PendingRequest as the String of its mangled type name (including its generic values) and the encoded JSON String. The encoded values look like:
Implements the
RequestCache
to persist failed requests. It usesStorage
to handle reading and writing to a file andCodableRequestContainer
to make an array of existentials encodable and decodable. It works by encoding each underlyingPendingRequest
as theString
of its mangled type name (including its generic values) and the encoded JSONString
. The encoded values look like:As
CodableRequestContainer
uses a Swift Foundation method that is only available on iOS 14+ this bumps the minimum supported version to iOS 14.0.Tests will be included in the next PR to keep the size of this one manageable.