-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement CachedURLResponse. #2245
Conversation
@swift-ci please test |
I need to double-check that the coding here is compatible with Darwin's, and this definitely needs coding fixtures. |
@millenomi: by coding fixtures you mean the files in |
@millenomi can you clarify your previous comment and how can I improve this PR? I would like to keep going with |
@drodriguez sorry for the radio silence — I would like to merge #2289 before letting other URLSession work continue for obvious reasons. |
That's awesome work. I will hold this and other URL related pieces until that other PR is in place. Tell me if I can help in anything. |
Foundation/URLCache.swift
Outdated
return nil | ||
} | ||
|
||
guard let data = aDecoder.decodeObject(of: NSData.self, forKey: "Data") else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the coding-related parts of this patch? The coding testing isn't done like this anymore (see FixtureValues.swift
and grep the codebase for codingRoundtrip
) and this isn't compatible with Darwin's encoding.
@drodriguez Are you interested in keeping this going? Otherwise, I will commandeer this, if that's okay with you. |
@millenomi: it is fine with me if you want to take command of this. I haven’t had time to came back to this and apply your previous comment. Thanks! |
@swift-ci please test |
Basically: we can store these things via coding if we so desire via an internal helper class; but if we're not publicly able to load and store archives that interoperate with Darwin, I'm not allowing encoding/decoding at all. |
@millenomi you might want to remove the test that checks |
Whoops, good point. |
Simple implementation for CachedURLResponse. The type seems to mostly be a data container with little behaviour. Implement the missing equality and hashing for URLResponse, which is used by CachedURLResponse. Implement tests for CachedURLResponse and the missing tests for equality and hashing in URLResponse.
5e0718f
to
3dd622b
Compare
@swift-ci please test |
Simple implementation for CachedURLResponse. The type seems to mostly be
a data container with little behaviour.
Implement the missing equality and hashing for URLResponse, which is
used by CachedURLResponse.
Implement tests for CachedURLResponse and the missing tests for
equality and hashing in URLResponse.
https://bugs.swift.org/browse/SR-10373