Invalid logbook when importing via iOS iCloud Synchronization

Discussion of the iOS App Dive Log
Post Reply
Posts: 746
Joined: Wed Mar 31, 2010 4:35 pm

Invalid logbook when importing via iOS iCloud Synchronization

Post by support »

A number of users have experienced problems using the "iOS iCloud Synchronization" feature of Dive Log to import (or sync) their logbooks on iOS 13. We have just released an update to Dive Log that should help resolve this issue. The new version is 3.2.13 and is available in the App Store.

When you import or synchronize a logbook using the iOS iCloud Synchronization you may still see a popup reporting that an error occurred (I'll explain the reason for this below) and if you do, just dismiss the popup and try your operation again. It should work on the next attempt.

This has been a particularly difficult issue to find and understand as it only affects a small number of users (and unfortunately, for debugging it, not me!) and is the result of a bug in iOS and/or iCloud that seems to have been introduced with iOS 13.

The way that iCloud (the particular part of iCloud used to support iOS iCloud Synchronization) works is that when you upload a logbook file to iCloud, the iCloud system makes all your other devices aware if it by downloading just the meta data for the file (i.e. the name, size and file type) but not the contents (at least the first time - once the file has been download once, iCloud preemptively downloads it the next time assuming you will want it local). On systems that are not encountering this bug Dive Log knows that the contents of the file are not downloaded yet and puts up a "cloud download" button next to the file name so you know that the file will need to download before you can use it. Then when you tap on the file name, Dive Log initiates the download of the file (showing a progress bar) and once it is fully downloaded performs the requested operation on the file.

On systems that are encountering the issue, iCloud still just downloads the meta data for the logbook file but it tells Dive Log that the file is completely downloaded. Further, when Dive Log then goes to open that file, the iCloud system returns a file containing a representation of the meta data instead of the contents of the logbook. We have reported this behavior to Apple and are working with them to resolve it.

In the meantime we have sorted out a workaround for this problem. We are able to detect when we have received the "meta data" instead of the actual contents of the logbook and are able to initiate a download of the actual logbook contents. However, the iCloud system still continues report that the file is downloaded and does not provide download progress update as it downloads. If we try the read the file again before the download completes we again get the meta data file. What we do in the workaround is wait for a short while and then try to read the file again. If the meta data is still returned we keep polling the file in this way for about 45 seconds total. In most cases this is enough time to get the full file, but in some cases (a slow network, a large logbook or Apple's servers are slow) it could take longer. Rather than keeping Dive Log unresponsive during this time, we show the error message giving you the opportunity to do something else and try again later (or immediately try again). Unless the download is very slow (or the network is unavailable) it should usually not take more than one additional try to get the file downloaded successfully.

As far as we can tell this affects only a relative small subset of users so hopefully it work for most people without seeing this issue (it seems that if you used the iOS iCloud Synchronization when you were still running iOS 12 or earlier that this issue does not show up but it happens more frequently if you use iOS iCloud Synchronization for the first time under iOS 13). We expect that an upcoming update to iOS 13 will fix this issue making the workaround unnecessary, but we will try to improve the workaround in the meantime as we learn more about this issue.

Also, anyone experiencing this issue can avoid it by using the Import/Export/Synchronize Dive Log Log option on the Synchronization tab as the problem does not affect accessing iCloud via those interfaces.

Post Reply