I never see this in my own testing but Sentry crash reports show that some real-world users are getting the following issue. I wonder how I continue to diagnose it.
TL;DR
Fetch (NetworkFetcher) calls the success closure but the data is apparently not ok.
myCache.fetch(URL: url, failure: {error in
print("Image fetch error \(String(describing: error)) setting image \(url)")
}, success: {data in
print("loaded image: \(url)")
if let image = UIImage(data: data) {
self.scrollView.display(image: image)
} else {
// This is where I want to figure out why data is not actually the image data.
// Would it make sense to remove this item from the cache here and have it re-download?
}
})
Questions / Ideas
Is Haneke caching the http response for 4XX or 5XX results? Then I might occasionally get a bad result from a sad server into the cache.
Some users could have a lot of images. Could this be a timing issue where the app gets a memory warning and the data is cleared before my code uses it to make a UIImage?
I never see this in my own testing but Sentry crash reports show that some real-world users are getting the following issue. I wonder how I continue to diagnose it.
TL;DR
Fetch (NetworkFetcher) calls the success closure but the data is apparently not ok.
Questions / Ideas
Is Haneke caching the http response for 4XX or 5XX results? Then I might occasionally get a bad result from a sad server into the cache.
Some users could have a lot of images. Could this be a timing issue where the app gets a memory warning and the
data
is cleared before my code uses it to make a UIImage?