>Something that took me a while to understand is that, when I fire up the tasks, I imediately set my app refresh task as completed.
>That was giving me headaches before because I was seting it as complete before it finished doing what it had to do.
This whole backgeound task / handle in watchOS is like some kind of weird puzzle put out by Apple for developers to collectively solve, with how little is truly understood about it. Apple's own example given here is wrong: https://developer.apple.com/library/content/samplecode/WatchBackgroundRefresh/Listings/WatchBackgroundRefresh_WatchKit_Extension_MainInterfaceController_swift.html
(If you listen to the WWDC talk about this, they say you're supposed to store the background Download Session Task into a variable, and complete it only when the downloads are completed - which is the correct way to do it, and it's not done in this sample code). I so wish they haven't obsoleted the old getNextRequestedUpdateDateWithHandler code for complication update. It was rock solid, reliable and so simple to use.
In any case, my test with removing all the main thread forcing has also resulted in the app crashing the same way after about 30 hours. One thing I noticed however is that I may have a problem with the fact that I handle the download task failures with doing the DownloadTask cancel for both tasks. When I intentionally produced a 404 download failure for one of the tasks, I've onserved that this cancel one time didn't do anything (becuase the other task finished regardless) and the other time it sent the whole process into some kind of a tailspin where a ton of repeated schedules and failures continued piling on, before it settled down. The app didn't crash, but what happened was clearly wrong. In the test I'm running now, I'm no longer doing any download tasks cancelling or any micromanaging of what happens when anything fails. I just have the task completion code in the URLSessionDidFinishEventsForBackgroundURLSession method, and tha's where I schedule next background refresh as well. As far as I can tell, this method fires regardless if the download tasks have completed successfully or not.
Also, I was seeing the error described here: https://stackoverflow.com/questions/46464660/wkrefreshbackgroundtask-cleanupstorage-error-attempting-to-reach-file
I don't know if that error is harmful in any way, but doing something along the lines what was suggested there, got rid of the error. I did this in the handle method, which I think is a better idea than what was suggested there:
for (WKRefreshBackgroundTask *task in backgroundTasks) {
userInfoAccess = task.userInfo;
I created the userInfoAccess variable on the class level, and then just assign that task userInfo value to it repeatedly.