Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix update detection for Dropbox #6069

Closed
wants to merge 2 commits into from

Conversation

PVince81
Copy link
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
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
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
Contributor

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

You need to look at the mimetype

@PVince81
Copy link
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
Copy link

ghost commented Nov 27, 2013

Test passed.
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/2169/

@karlitschek
Copy link
Contributor

ping

@enoch85
Copy link
Member

enoch85 commented May 23, 2014

Just tested this, and it works for me.

@PVince81
Copy link
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
Copy link
Member

enoch85 commented May 23, 2014

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
Copy link
Member

enoch85 commented Aug 6, 2014

What about this @PVince81 ?

@ghost
Copy link

ghost commented Oct 6, 2014

💣 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
Copy link

ghost commented Oct 15, 2014

💣 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
Copy link

ghost commented Nov 21, 2014

💣 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
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.

None yet

6 participants