vimeo / VIMNetworking

The Vimeo iOS SDK
MIT License
58 stars 25 forks source link

Problem with upload tasks after killing app #123

Closed Gamec closed 9 years ago

Gamec commented 9 years ago

I have two problems with using app after it has been killed.

First one (with log below) happens when I kill app while file is copyied to tmp directory. It's not possible to run app again, you have to reinstall it. Crashes immidiately.

Second one happens when I kill app during upload. Here I can run app again, but task is not resumed, and if I add another task it's not started (but is displayed in task queue in console log).

2015-08-25 16:32:07.335 App[9628:1898338] NSManagedContext did save.
2015-08-25 16:32:07.452 App[9628:1898338] [Crashlytics] Version 3.1.0 (65)
2015-08-25 16:32:07.799 App[9628:1898338] --LOAD 0
2015-08-25 16:32:07.799 App[9628:1898338] --INIT
2015-08-25 16:32:07.849 App[9628:1898338] --LOAD 0
2015-08-25 16:32:07.849 App[9628:1898338] --INIT
2015-08-25 16:32:07.910 App[9628:1898370] SAVING: {
    tasks =     (
    );
}
2015-08-25 16:32:07.912 App[9628:1898370] *** Assertion failure in -[VIMUploadTask resume], /Users/xxx/Documents/App/GitHub/iOSb/App/Pods/VIMNetworking/VIMNetworking/Networking/Upload/UploadTaskQueue/VIMUploadTask.m:118
2015-08-25 16:32:07.912 App[9628:1898372] SAVING: {
    tasks =     (
    );
}
2015-08-25 16:32:07.918 App[9628:1898372] --NEXT 0: queue complete!
2015-08-25 16:32:07.920 App[9628:1898370] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot start a finished task'
*** First throw call stack:
(0x182cf422c 0x1946500e4 0x182cf40ec 0x183ba8ed4 0x1002daf0c 0x1002d2a10 0x1002d208c 0x100c2cfd4 0x100c2cf94 0x100c37db8 0x100c302c4 0x100c3a5d4 0x100c3c248 0x194ead21c 0x194eacee0)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
alfiehanssen commented 9 years ago

Please provide some additional info on how you're setting up and using the upload system.

The crash you're getting is being triggered by an NSAssert statement in one of the upload tasks. Flagging an attempt to re-start an already complete task. Which leads me to believe that something is amiss with your setup.

Also, consider splitting these into two different Github issues as they are two separate problems that you are encountering.

We've tested crashing the app mid-copy and mid-upload and the queue should recover upon subsequent launch. Which is not to say there may not be bugs. Either way, additional info and code would be helpful.

alfiehanssen commented 9 years ago

Unable to reproduce. Closing this until further information is provided.