Skip to content

[WIP] Fix update detection for Dropbox - #6069

Closed
PVince81 wants to merge 2 commits into
masterfrom
extstorage-dropbox-hasupdated
Closed

PVince81 wants to merge 2 commits into
masterfrom
extstorage-dropbox-hasupdated

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

⛔ NO MERGE

Now using Dropbox hash as etag.
The current solution is clumsy and unefficient.

I think I'll have a try using the "rev" attribute next, as the current solution requires loading the whole directory listing, else Dropbox doesn't deliver the hash attr.
For some reason, when I read the hash from the storage cache it already has the latest value, so hasUpdated() is always false for dirs. Still, refreshing seems to work...

FYI @icewind1991

Now using Dropbox hash as etag.
The current solution is clumsy and unefficient.
@icewind1991

Copy link
Copy Markdown
Contributor

For hasUpdated you can pass the existing hash to the metadata call (see https://www.dropbox.com/developers/core/docs#metadata) and speedup the cases where the folder hasn't changed

Also, does the hash value of a folder changed when a file nested multiple levels deep has changed?

@PVince81

Copy link
Copy Markdown
Contributor Author

Yes. The only issue is I need to pass "true" to list to get the new hash.
I used the current approach because I wanted to know whether I was looking at a directory ("is_dir" attribute). Strangely we don't have "is_dir" in the storage cache...

Whether hash value changes for nested changes is a good question, something I intended to try out.

@icewind1991

Copy link
Copy Markdown
Contributor

Strangely we don't have "is_dir" in the storage cache...

You need to look at the mimetype

@PVince81

Copy link
Copy Markdown
Contributor Author

Just checked, if you have a dir "dir1/dir2/" and you create a subdir "dir3" in "dir2", the hash of 'dir1" will change.

I've changed to code to pass the existing hash to Dropbox, but for some unknown reason it returns 401 Unauthorized (same arguments without the hash work). Not sure what's going on, so I've put in a dirty workaround.

There is still some work to be put into this before it can work efficiently.

Detecting updates now works though, but is wasteful / slow.

@ghost

ghost commented Nov 27, 2013

Copy link
Copy Markdown

@karlitschek

Copy link
Copy Markdown
Contributor

ping

@enoch85

enoch85 commented May 23, 2014

Copy link
Copy Markdown

Just tested this, and it works for me.

@PVince81

Copy link
Copy Markdown
Contributor Author

@enoch85 wow, thanks for testing.
I didn't have time to look into the details of this PR.
Also the code is VERY inefficient and might slow down a lot with many files.
But good to know that it works 😄

@enoch85

enoch85 commented May 23, 2014

Copy link
Copy Markdown

Yeah, no problem. Just a simple test though.

  • Upload file in Dropbox WebUI (sync ok!)
  • Upload file in Owncloud Client folder (sync ok!)
  • Upload file in Owncloud WebUI (sync ok!)
  • Delete file in Dropbox WebUI (sync ok!) Takes forever to sync though and it seems that it only detect changes when uploading to the Dropbox WebUI.
  • Delete file in Owncloud Client folder (sync ok!)
  • Delete file in Owncloud WebUI (sync ok!)

@enoch85

enoch85 commented Aug 6, 2014

Copy link
Copy Markdown

What about this @PVince81 ?

@ghost

ghost commented Oct 6, 2014

Copy link
Copy Markdown

💣 Test FAILed. 💣
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng/98/

@ghost

ghost commented Oct 15, 2014

Copy link
Copy Markdown

💣 Test FAILed. 💣
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/170/
💣 Test FAILed. 💣

@ghost

ghost commented Nov 21, 2014

Copy link
Copy Markdown

💣 Test FAILed. 💣
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/3055/
💣 Test FAILed. 💣

@PVince81

Copy link
Copy Markdown
Contributor Author

Closing. We shall look into use Flysystem's Dropbox implementation instead.

@PVince81 PVince81 closed this Mar 18, 2015
@MorrisJobke
MorrisJobke deleted the extstorage-dropbox-hasupdated branch May 18, 2015 09:32
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants