Skip to content
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

Troubleshooting when success is not success #456

Open
eimermusic opened this issue Dec 20, 2019 · 0 comments
Open

Troubleshooting when success is not success #456

eimermusic opened this issue Dec 20, 2019 · 0 comments

Comments

@eimermusic
Copy link

eimermusic commented Dec 20, 2019

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?

@eimermusic eimermusic changed the title Troubleshooting success not being a success Troubleshooting when success is not success Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant