<?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 Re: Handling File Rename/Move in the API [filesListFolderContinue] in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427709#M22776</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;I'm currently using the id field to track move/renames. But the problem was basically that I am unable to differentiate a DELETE from a MOVE. It's not a big problem if some of the actions are&amp;nbsp;idempotent, but unfortunately, they are.&lt;/P&gt;
&lt;P&gt;Does dropbox have any plans to fix this behavior and allow the ability to differentiate between a DELETE and a MOVE?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, I'm not aware of plans to change how this works. If this case is common for your app and it's more effective for your app to process these filesListFolder entries together, you could consider adding a small delay after receiving a 'deleted' entry to catch the potential following additions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;You can also use filesListFolderLongpoll to get low-latency monitoring for changes.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does this avoid the previous problem?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, this doesn't avoid the issue, but I mentioned it as it may make things faster in your app since it's a way to quickly detect changes. E.g., if you query and get just the deletion, the longpoll would let you know about any&amp;nbsp;further changes, such as an addition, as soon as possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Also, is there a reason why the id is not included in the deleted files?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is due to how the&amp;nbsp;Dropbox filesystem is implemented. The 'deleted' entry just indicates that something used to exist at that path, but does not itself have&amp;nbsp;the id of that item (or item(s)) that used to be there.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jun 2020 16:52:28 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2020-06-08T16:52:28Z</dc:date>
    <item>
      <title>Handling File Rename/Move in the API [filesListFolderContinue]</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427410#M22769</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to build a blogging platform powered by markdown files in dropbox.&lt;/P&gt;&lt;P&gt;So, I need to keep the file and the blog in sync.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To do this, I am using filesListFolderContinue (JS SDK) and pass the cursor from the previous sync to get the diff.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One issue I see is that on a slow/flaky connection or when large files are renamed or moved, dropbox API responds with a delete only as opposed to a delete &lt;STRONG&gt;and&lt;/STRONG&gt; a new file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example below:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[1] When I rename the file&amp;nbsp;original-file.txt to new-file.txt, the response from&amp;nbsp;filesListFolderContinue is:&lt;/P&gt;&lt;PRE&gt;{
  entries: [
    {
      '.tag': 'deleted',
      name: 'original-file.txt',
      path_lower: '/test/original-file.txt',
      path_display: '/test/original-file.txt'
    }
  ],
  cursor: '...',
  has_more: false
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[2] Just a few seconds later, the response includes the new file is includes, using the same cursor:&lt;/P&gt;&lt;PRE&gt;{
  entries: [
    {
      '.tag': 'deleted',
      name: 'original-file.txt',
      path_lower: '/test/original-file.txt',
      path_display: '/test/original-file.txt'
    },
    {
      '.tag': 'file',
      name: 'new-file.txt',
      path_lower: '/test/new-file.txt',
      path_display: '/test/new-file.txt',
      ...
    }
  ],
  cursor: '...',
  has_more: false
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I expected to only see the second response, without ever being able to see the first, as there is no way to differentiate an actual Delete vs a Move or a Rename.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any recommendations to handle this scenario and differentiate a DELETE VS MOVE/RENAME.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 18:40:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427410#M22769</guid>
      <dc:creator>manishrc</dc:creator>
      <dc:date>2020-06-07T18:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Handling File Rename/Move in the API [filesListFolderContinue]</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427673#M22773</link>
      <description>&lt;P&gt;There can be a slight delay between new entries like this, as you found. The deletion and addition of a file for a rename or move operation aren't guaranteed to be delivered together, so if you happen to call at the right time you might see the deletion without the addition. If you later call back again to&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesListFolderContinue__anchor" target="_self"&gt;filesListFolderContinue&lt;/A&gt; using that returned cursor, you should then see the addition though, so once you process all of the entries the result should be the same.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can also use&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesListFolderLongpoll__anchor" target="_self"&gt;filesListFolderLongpoll&lt;/A&gt; to get low-latency monitoring for changes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, note that you can track the &lt;A href="https://dropbox.github.io/dropbox-sdk-js/global.html#FilesFileMetadata" target="_self"&gt;Metadata&lt;/A&gt;.id for the original file and then the addition of the file at the new path to keep track of files across moves/renames, since the file ID won't change for moves/renames.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 15:16:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427673#M22773</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-06-08T15:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Handling File Rename/Move in the API [filesListFolderContinue]</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427701#M22775</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently using the id field to track move/renames. But the problem was basically that I am unable to differentiate a DELETE from a MOVE. It's not a big problem if some of the actions are&amp;nbsp;idempotent, but unfortunately, they are.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does dropbox have any plans to fix this behavior and allow the ability to differentiate between a DELETE and a MOVE?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;You can also use filesListFolderLongpoll to get low-latency monitoring for changes.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Does this avoid the previous problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, is there a reason why the id is not included in the deleted files?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 16:12:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427701#M22775</guid>
      <dc:creator>manishrc</dc:creator>
      <dc:date>2020-06-08T16:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Handling File Rename/Move in the API [filesListFolderContinue]</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427709#M22776</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;I'm currently using the id field to track move/renames. But the problem was basically that I am unable to differentiate a DELETE from a MOVE. It's not a big problem if some of the actions are&amp;nbsp;idempotent, but unfortunately, they are.&lt;/P&gt;
&lt;P&gt;Does dropbox have any plans to fix this behavior and allow the ability to differentiate between a DELETE and a MOVE?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, I'm not aware of plans to change how this works. If this case is common for your app and it's more effective for your app to process these filesListFolder entries together, you could consider adding a small delay after receiving a 'deleted' entry to catch the potential following additions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;You can also use filesListFolderLongpoll to get low-latency monitoring for changes.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does this avoid the previous problem?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, this doesn't avoid the issue, but I mentioned it as it may make things faster in your app since it's a way to quickly detect changes. E.g., if you query and get just the deletion, the longpoll would let you know about any&amp;nbsp;further changes, such as an addition, as soon as possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Also, is there a reason why the id is not included in the deleted files?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is due to how the&amp;nbsp;Dropbox filesystem is implemented. The 'deleted' entry just indicates that something used to exist at that path, but does not itself have&amp;nbsp;the id of that item (or item(s)) that used to be there.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 16:52:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427709#M22776</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-06-08T16:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Handling File Rename/Move in the API [filesListFolderContinue]</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427738#M22778</link>
      <description>Thank you for your help.</description>
      <pubDate>Mon, 08 Jun 2020 18:25:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Handling-File-Rename-Move-in-the-API-filesListFolderContinue/m-p/427738#M22778</guid>
      <dc:creator>manishrc</dc:creator>
      <dc:date>2020-06-08T18:25:48Z</dc:date>
    </item>
  </channel>
</rss>

