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

Include option to allow scanner to reuse etags only for files #37218

Merged
merged 2 commits into from
Apr 20, 2020

Conversation

jvillafanez
Copy link
Member

This option will be used by the watcher, in case it detects a change in
a folder, so the etag of the folder will always change (not just
depending on mtime) but the contents might retain its current etag.

Description

Changes in gdrive weren't being propagated properly because the mtime of the folder doesn't change when a file is added / removed / modified there.
The etag of the folder didn't change, so the desktop client loses track of where to look for changes once it reaches the modified folder. This means that the new files inside the folder don't appear in the desktop (files aren't removed neither)

Note that the mtime of the folder in ownCloud still be the same as the one reported by gdrive

Related Issue

owncloud/client#7837 (comment)

Motivation and Context

gdrive integration don't behave like other external storages from a desktop client's perspective otherwise.

How Has This Been Tested?

Manually checked:

  1. Connect ownCloud with a gdrive account
  2. Let desktop client sync normally the first time
  3. Add a new file directly in a folder inside the gdrive account
  4. Make a propfind to the target folder (you can navigate the ownCloud's web UI to the target folder instead) to detect the change
  5. Sync client should pick up the change

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

This option will be used by the watcher, in case it detects a change in
a folder, so the etag of the folder will always change (not just
depending on mtime) but the contents might retain its current etag.
@update-docs
Copy link

update-docs bot commented Apr 7, 2020

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@codecov
Copy link

codecov bot commented Apr 7, 2020

Codecov Report

Merging #37218 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #37218   +/-   ##
=========================================
  Coverage     64.87%   64.88%           
- Complexity    19146    19151    +5     
=========================================
  Files          1269     1269           
  Lines         74947    74950    +3     
  Branches       1331     1331           
=========================================
+ Hits          48625    48628    +3     
  Misses        25930    25930           
  Partials        392      392           
Flag Coverage Δ Complexity Δ
#javascript 54.14% <ø> (ø) 0.00 <ø> (ø)
#phpunit 66.07% <100.00%> (+<0.01%) 19151.00 <0.00> (+5.00)
Impacted Files Coverage Δ Complexity Δ
lib/private/Files/Cache/Scanner.php 87.55% <100.00%> (+0.12%) 118.00 <0.00> (+4.00)
lib/private/Files/Cache/Watcher.php 100.00% <100.00%> (ø) 17.00 <0.00> (ø)
...AppFramework/Utility/ControllerMethodReflector.php 100.00% <0.00%> (ø) 10.00% <0.00%> (ø%)
...les_sharing/lib/Controller/RemoteOcsController.php 95.31% <0.00%> (+0.07%) 17.00% <0.00%> (+1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8ae99c...564b5f1. Read the comment docs.

@jvillafanez
Copy link
Member Author

jvillafanez commented Apr 7, 2020

@pmaier1 I'll need confirmation whether this PR will be in 10.4.1 or 10.5.0.
If this will be available in 10.4.1, we'll need to close this PR and open a new one targeting 10.4.1

Changelog entry to be added after confirmation.

@mmattel
Copy link
Contributor

mmattel commented Apr 7, 2020

This could be related: #37170
(Browser reload does not always triggers a sync if new file is found created via external write)

@micbar @pmaier1 highly appreciate if this could go into 10.4.1

@jvillafanez
Copy link
Member Author

#37170 should be fixed with this PR. The target use case is the same.

@micbar
Copy link
Contributor

micbar commented Apr 7, 2020

@jvillafanez @mmattel I have doubts for 10.4.1.

It touches a central part of core (etag propagation)
One could argument, that this change requires a minor version.

I would like to avoid the testing effort now. 10.4.1 should be out 1-2 days. This would delay other important fixes.

IMO waiting for a fix of Gdrive external storage compared to a very urgent bugfix of password_policy is an easy decision.

@pmaier1 @HanaGemela open for your input.

@HanaGemela
Copy link
Contributor

I wouldn't delay 10.4.1

@pmaier1
Copy link
Contributor

pmaier1 commented Apr 8, 2020

10.4.1 is closed and should not be delayed by this. THX!

@DeepDiver1975 DeepDiver1975 merged commit c319878 into master Apr 20, 2020
@delete-merged-branch delete-merged-branch bot deleted the gdrive_folder_fix branch April 20, 2020 08:31
@mrow4a
Copy link
Contributor

mrow4a commented Apr 20, 2020

@jvillafanez I think we might have similar issue with fed shares. I noticed that browsing in UI also mixes etag propagation.

Try to verify this scenario:

  • pause sync client
  • add the files in gdrive in test1/test1.1/test1.1.1/test1.1.1.1
  • navigate in UI to test1, and to test1.1
  • unpause to sync in sync client -> it might happen changes won't be detected

@mmattel
Copy link
Contributor

mmattel commented Apr 23, 2020

@mrow4a it would be a good idea to create a new issue so we can track it.
This comment gets definitely lost...

@mrow4a
Copy link
Contributor

mrow4a commented Apr 23, 2020

@mmattel ignore it for now, external storages are working a bit differently than shared external storages. if we get similar issue, maybe this would be good hint for someone.

jvillafanez added a commit that referenced this pull request Sep 29, 2020
The scanner's update method will reuse the size if possible.
REUSE_ONLY_FOR_FILES flag will only be applicable to etag, not size
Links to #37218
@jvillafanez jvillafanez mentioned this pull request Sep 29, 2020
11 tasks
jvillafanez added a commit that referenced this pull request Oct 9, 2020
The scanner's update method will reuse the size if possible.
REUSE_ONLY_FOR_FILES flag will only be applicable to etag, not size
Links to #37218
JammingBen pushed a commit that referenced this pull request Nov 23, 2020
The scanner's update method will reuse the size if possible.
REUSE_ONLY_FOR_FILES flag will only be applicable to etag, not size
Links to #37218
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants