<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Deleted files are automatically restored. in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/473877#M24060</link>
    <description>&lt;P&gt;As shown in sample 1, "delete_V2" alone will succeed in deletion, but as in sample 2, the combination of "unshare Folder" and "delete_V2" will automatically restore the deleted file (folder).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;// sample 1&lt;BR /&gt;[[userClient.filesRoutes delete_V2:path]
    setResponseBlock:^(DBFILESDeleteResult * _Nullable result,
    DBFILESDeleteError * _Nullable routeError, DBRequestError * _Nullable networkError) {
    if(result) {
    } else {
    }
}];&lt;/PRE&gt;
&lt;PRE&gt;// sample 2
[[userClient.sharingRoutes unshareFolder:shareID]
    setResponseBlock:^(DBASYNCLaunchEmptyResult * _Nullable result,
    DBSHARINGUnshareFolderError * _Nullable routeError, DBRequestError * _Nullable networkError) {
    if(result) {
        [[userClient.filesRoutes delete_V2:path]
 	    setResponseBlock:^(DBFILESDeleteResult * _Nullable dresult,
    	    DBFILESDeleteError * _Nullable routeError, DBRequestError * _Nullable networkError) {
    	    if(dresult) {
            } else {
            }
        }];
    } else {
    }
}];&lt;/PRE&gt;
&lt;P&gt;Even if you delete from unshare or unshare from delete, it will be automatically restored.&lt;/P&gt;
&lt;P&gt;However, I can delete it if there is some time between unshare and delete. But the result is very volatile.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to safely delete by running unshare and delete at the same time?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Nov 2020 14:08:50 GMT</pubDate>
    <dc:creator>Nue</dc:creator>
    <dc:date>2020-11-27T14:08:50Z</dc:date>
    <item>
      <title>Deleted files are automatically restored.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/473877#M24060</link>
      <description>&lt;P&gt;As shown in sample 1, "delete_V2" alone will succeed in deletion, but as in sample 2, the combination of "unshare Folder" and "delete_V2" will automatically restore the deleted file (folder).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;// sample 1&lt;BR /&gt;[[userClient.filesRoutes delete_V2:path]
    setResponseBlock:^(DBFILESDeleteResult * _Nullable result,
    DBFILESDeleteError * _Nullable routeError, DBRequestError * _Nullable networkError) {
    if(result) {
    } else {
    }
}];&lt;/PRE&gt;
&lt;PRE&gt;// sample 2
[[userClient.sharingRoutes unshareFolder:shareID]
    setResponseBlock:^(DBASYNCLaunchEmptyResult * _Nullable result,
    DBSHARINGUnshareFolderError * _Nullable routeError, DBRequestError * _Nullable networkError) {
    if(result) {
        [[userClient.filesRoutes delete_V2:path]
 	    setResponseBlock:^(DBFILESDeleteResult * _Nullable dresult,
    	    DBFILESDeleteError * _Nullable routeError, DBRequestError * _Nullable networkError) {
    	    if(dresult) {
            } else {
            }
        }];
    } else {
    }
}];&lt;/PRE&gt;
&lt;P&gt;Even if you delete from unshare or unshare from delete, it will be automatically restored.&lt;/P&gt;
&lt;P&gt;However, I can delete it if there is some time between unshare and delete. But the result is very volatile.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to safely delete by running unshare and delete at the same time?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 14:08:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/473877#M24060</guid>
      <dc:creator>Nue</dc:creator>
      <dc:date>2020-11-27T14:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Deleted files are automatically restored.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/473965#M24077</link>
      <description>&lt;P&gt;Deleting a shared folder will "unmount" that shared folder, but will not "unshare" it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unsharing a shared folder will "unmount" and "unshare" it for all users and the owner can choose whether or not the other members should be able to keep a copy, via &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBSHARINGUserAuthRoutes.html#/c:objc(cs)DBSHARINGUserAuthRoutes(im)unshareFolder:leaveACopy:" target="_self"&gt;-unshareFolder:leaveACopy:&lt;/A&gt;. The owner will always retain their own copy though. The act of retaining the owner's own copy is effectively a matter of re-adding a non-shared copy of the folder though, which is why you may see this conflict with a delete call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For that reason, you should not perform both the delete and the unshare at the same time. If you want to unshare a shared folder, and delete the retained copy, you should wait until the unshare is complete before issuing the delete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBSHARINGUserAuthRoutes.html#/c:objc(cs)DBSHARINGUserAuthRoutes(im)unshareFolder:" target="_self"&gt;unshareFolder&lt;/A&gt; operation can run asynchrounously though, so the actual unshare job may not be complete&amp;nbsp;by the time the&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBSHARINGUserAuthRoutes.html#/c:objc(cs)DBSHARINGUserAuthRoutes(im)unshareFolder:" target="_self"&gt;unshareFolder&lt;/A&gt; call itself returns. You need to check if&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBSHARINGUserAuthRoutes.html#/c:objc(cs)DBSHARINGUserAuthRoutes(im)unshareFolder:" target="_self"&gt;unshareFolder&lt;/A&gt; returned an async job ID to you, and then poll &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBSHARINGUserAuthRoutes.html#/c:objc(cs)DBSHARINGUserAuthRoutes(im)checkJobStatus:" target="_self"&gt;checkJobStatus&lt;/A&gt; to check if the job is complete. Only once it's complete should you then proceed to delete the retained copy, if you wish to.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 18:08:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/473965#M24077</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-11-27T18:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Deleted files are automatically restored.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/474073#M24080</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand why the deleted files are restored.&lt;/P&gt;&lt;P&gt;So I tried the following.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Unshare the folder using "unshare Folder:".&lt;BR /&gt;2) Wait for the above completion until "result.isComplete" becomes true using "checkJobStatus:".&lt;BR /&gt;3) After finishing the above, delete the above folder using "delete_v2:".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result works well when there are few subfolders and files, but unfortunately the copy is restored when there are many subfolders and files.&lt;/P&gt;&lt;P&gt;So, before doing the above "unshare Folder:", I did the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0-a) Use "deleteBatch:" to delete the subfolders and files under the above folder.&lt;BR /&gt;0-b) Use "deleteBatchCheck:" and wait until deleteBatch finishes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This process allowed me to delete even large shared folders.&lt;/P&gt;&lt;P&gt;Is this process flow correct? Or is there a better way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 01:32:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/474073#M24080</guid>
      <dc:creator>Nue</dc:creator>
      <dc:date>2020-11-28T01:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Deleted files are automatically restored.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/474601#M24092</link>
      <description>&lt;P&gt;Yes, unfortunately the re-addition of the retained copy can take some time to complete even after the unshare job itself is "complete". To&amp;nbsp;accommodate that, you can delete the contents first if you wish, but it may be more direct to wait until re-addition is complete after the unshare and then delete it. You could do so by adding a sufficient delay, or checking for the existence of the re-added folder before issuing the delete.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 17:54:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/474601#M24092</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-11-30T17:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Deleted files are automatically restored.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/475043#M24108</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;BR /&gt;Is there a way to distinguish between the original folder and the re-added folder?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 00:03:21 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/475043#M24108</guid>
      <dc:creator>Nue</dc:creator>
      <dc:date>2020-12-02T00:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Deleted files are automatically restored.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/475235#M24111</link>
      <description>&lt;P&gt;Yes, you could distinguish between shared and not shared folders by checking the metadata, e.g., by using&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESUserAuthRoutes.html#/c:objc(cs)DBFILESUserAuthRoutes(im)getMetadata:" target="_self"&gt;getMetadata&lt;/A&gt;. If it's a shared folder, the&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESFolderSharingInfo.html#/c:objc(cs)DBFILESFolderSharingInfo(py)sharedFolderId" target="_self"&gt;DBFILESFolderSharingInfo.sharedFolderId&lt;/A&gt; in the returned&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESFolderMetadata.html#/c:objc(cs)DBFILESFolderMetadata(py)sharingInfo" target="_self"&gt;DBFILESFolderMetadata.sharingInfo&lt;/A&gt; will be set. It will not be set if it is not a shared folder.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 15:00:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/475235#M24111</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-12-02T15:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Deleted files are automatically restored.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/476295#M24139</link>
      <description>&lt;P&gt;Thank you very much. I can now reliably handle it in the following way:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1) Unshare the folder and wait until it is complete.&lt;BR /&gt;2) Wait for the folder to be re-added.&lt;BR /&gt;3) Delete the folder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that I get a "too_many_write_operations" error when I try to delete the re-added folder immediately. So I need to wait a bit for the delete and retry the delete if I get this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this way is the safest way I have ever done, as it can reliably determine the end of processing when the folder is successfully deleted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2020 01:19:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Deleted-files-are-automatically-restored/m-p/476295#M24139</guid>
      <dc:creator>Nue</dc:creator>
      <dc:date>2020-12-05T01:19:24Z</dc:date>
    </item>
  </channel>
</rss>

