Just for fun while I wait, this is my guess at how this could have happened:
- Files on iCloud Drive are obviously stored in a certain format, metadata, etc, and that format will change over time as features are added, so they also probably have a version associated with each file so that the format can be quickly determined.
- When you upgrade to iOS 10, it probably tells iCloud to move you to the next major version of the iCloud Drive service to ensure you support some new iOS features. That can be done without needing your password, so happens during the installation.
- This new iCloud Drive version probably drops support for certain older file versions, so those files will need upgrading. But this requires your password because the data is encrypted, and therefore once installed iOS 10 should ask for your iCloud password as part of the welcome process, and then tell iCloud to upgrade the files.
- Because we were never shown the welcome screen, our files were never upgraded. Probably files created in the last few months are already compatible, hence I can still see a handful that I created recently.
- Probably iCloud Drive has some logic that says a file is considered deleted if either:
- It is marked as deleted.
- It has a version older than MINIMUM_SUPPORTED_VERSION.
Hence (almost) all our files are now magically considered deleted.
Disclaimer: I have never built a cloud storage service, the above is a complete guess 🙂