venmo / DVR

Network testing for Swift
http://blog.soff.es/network-testing-in-swift-with-dvr
MIT License
651 stars 86 forks source link

Fatal error when using DownloadTask when cassette is not available #35

Open mihaigeorgescu-newstore opened 8 years ago

mihaigeorgescu-newstore commented 8 years ago

DownloadTask crashes with message "[DVR] Something has gone horribly wrong." when trying to download a file from a remote location. I am getting the same message even when i am using the example test for downloadTask. The url is valid and the file is there because i download with the sharedSession the file from that URL, and it downloads successfully.

mihaigeorgescu-newstore commented 8 years ago

So from what i see the issue is that the task, created by the downloadTask is not retained and it will be released, which will cause the app to crash in the completion block. Besides that, if you retain that task it won't get released because when it will finish, it will call session.finishTask which doesn't have it in the outstandingTasks array.

So as a conclusion i think the downladTask is not functional and the architecture doesn't support it for the moment.