Issue

Christopher
Technical Support
StableBit CloudDrive
Public
Alex

Destroying a drive, for all providers, follows these general steps:
  1. If the drive is mounted, perform a forced and destructive unmount (destructive means we don't care if the file system is not ready, don't wait).
    1. Close all internal management handles to the cache / drive.
  2. If the drive is not mounted, dispose of all data structures used to manage it.
  3. Remove the CloudPart... folder and all streams in it.
  4. Delete the provider metadata in the cloud.
  5. Mark the drive detached in the cloud.
  6. Delete all provider data in the cloud.
  7. Remove knowlege of the drive from the application state (Store).
This applies to all drives, but each provider implemented steps 4, 5, and 6 according to its own implementation, and these can fail. If they so fail, we write out a warning and continue.

Generally, 4 and 5 is a 1:1 API call. But step 6 can result in multiple calls to the provider, depending on whether it supports deleting the entire cloud part in one call or not. Google Drive does, so for Google destruction involves 3 API calls, 2 to delete the metadata and attachment into, and the 3rd deleted the CloudPart folder in the cloud.

I'm not sure how we would check for these orphaned files. If the entire folder is deleted with a single API call, I don't see what else can we do. I'll try to reproduce this and see if I can get it to break that way.