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

Set VFS PinState to Excluded for ignored files. #5853

Merged
merged 3 commits into from
Jul 20, 2023

Conversation

m7913d
Copy link
Contributor

@m7913d m7913d commented Jul 2, 2023

Setting PinState to Excluded ensures the syncing icon is not shown for ignored items.
If the PinState is not set to Excluded, also all parent directories are shown as being synced, which is very inconvenient for the end user as it seems that some folder are never fully synced by Nextcloud which isn't the case.
As long as .lnk files are not converted to placeholder files, also set them to Excluded to hide the syncing icon.

Closes #5524
Closes #5594
Closes #5825

@m7913d
Copy link
Contributor Author

m7913d commented Jul 2, 2023

  1. Note that this implementation generates many warnings "Couldn't find pin state for regular non-placeholder file" when calling VfsCfApi::pinStateLocal inside Folder::slotWatchedPathChanged on non placeholder files. Not sure if this warning is relevant. Note that we could set the PinState on non placeholder files, but querying the PinState seems to fail. OneDrive seems to do the same.

  2. When setting the PinState to Excluded no sync icon is shown for that file. However, on OneDrive a special 'excluded' icon is shown:
    afbeelding
    I'm not sure if and how we can set such an icon too, but showing no icon is at least much better than showing the syncing icon indefinitely.

@m7913d m7913d force-pushed the ignoredFilesExcludedPinState branch 2 times, most recently from 54de074 to fed55a1 Compare July 2, 2023 17:49
@m7913d
Copy link
Contributor Author

m7913d commented Jul 5, 2023

@mgallien Is this PR eligible to be merged? Should someone else review this PR? Please do not hesitate to contact me if you need more information or something should be changed prior to being merged.

@mgallien
Copy link
Collaborator

mgallien commented Jul 7, 2023

@m7913d sorry for the delayed review
thanks a lot for your PR
I added people to the list of reviewers
should help with getting timely review
cannot promise when I will be able to do it myself

@mgallien mgallien force-pushed the ignoredFilesExcludedPinState branch from fed55a1 to ae2ce45 Compare July 7, 2023 12:47
@m7913d
Copy link
Contributor Author

m7913d commented Jul 9, 2023

Note that the "Windows Build and Test / Build" workflow fails due to external changes. PR #5874 provides a fix for this failed workflow. Please rerun the check after that PR is approved.

@mgallien mgallien force-pushed the ignoredFilesExcludedPinState branch from ae2ce45 to e1d7804 Compare July 11, 2023 16:03
Copy link
Collaborator

@mgallien mgallien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot

src/gui/folder.cpp Outdated Show resolved Hide resolved
src/gui/folder.h Outdated Show resolved Hide resolved
src/gui/folderwatcher.h Outdated Show resolved Hide resolved
src/libsync/vfs/cfapi/vfs_cfapi.h Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Merging #5853 (55f27cd) into master (7524853) will decrease coverage by 0.18%.
The diff coverage is 69.23%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5853      +/-   ##
==========================================
- Coverage   60.06%   59.88%   -0.18%     
==========================================
  Files         145      145              
  Lines       18746    18756      +10     
==========================================
- Hits        11259    11232      -27     
- Misses       7487     7524      +37     
Impacted Files Coverage Δ
src/common/pinstate.h 0.00% <ø> (ø)
src/libsync/vfs/cfapi/cfapiwrapper.cpp 73.07% <50.00%> (+0.12%) ⬆️
src/libsync/vfs/cfapi/vfs_cfapi.cpp 82.44% <72.72%> (-0.63%) ⬇️

... and 6 files with indirect coverage changes

src/gui/folderwatcher.cpp Outdated Show resolved Hide resolved
src/gui/folder.cpp Outdated Show resolved Hide resolved
Copy link
Contributor Author

@m7913d m7913d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small coding improvements

src/libsync/vfs/cfapi/vfs_cfapi.cpp Outdated Show resolved Hide resolved
src/gui/folder.cpp Outdated Show resolved Hide resolved
src/gui/folder.cpp Outdated Show resolved Hide resolved
src/gui/folder.cpp Outdated Show resolved Hide resolved
@m7913d m7913d force-pushed the ignoredFilesExcludedPinState branch from f56ae85 to 6fdf0f0 Compare July 14, 2023 08:12
@m7913d m7913d requested a review from mgallien July 14, 2023 08:40
@mgallien mgallien force-pushed the ignoredFilesExcludedPinState branch from 6fdf0f0 to 6262336 Compare July 17, 2023 07:45
@mgallien
Copy link
Collaborator

@m7913d could you squash your commits as I do not think it is needed to keep 3 commits ?
then I approve and make sure this is merged
thanks again for your contribution

@mgallien
Copy link
Collaborator

/backport to stable-3.9

@m7913d
Copy link
Contributor Author

m7913d commented Jul 17, 2023

@mgallien Commits are squashed.

@m7913d
Copy link
Contributor Author

m7913d commented Jul 17, 2023

@mgallien @claucambra As mentioned in my second comment, this PR generates a lot of warnings "Couldn't find pin state for regular non-placeholder file". Is this ok for you? Should we remove the warning, lower the warning to a debug/info message or use another function to check if the file has a pin state?

@mgallien
Copy link
Collaborator

@mgallien @claucambra As mentioned in my second comment, this PR generates a lot of warnings "Couldn't find pin state for regular non-placeholder file". Is this ok for you? Should we remove the warning, lower the warning to a debug/info message or use another function to check if the file has a pin state?

@m7913d I think (but I cannot check) that this warning dates from the early stages of this code
I would go with debug level as I would not expect this warning to really be useful now
thanks for pinging us about this as I had overlooked your question

@m7913d m7913d force-pushed the ignoredFilesExcludedPinState branch 4 times, most recently from 7baa0bc to 793c99b Compare July 18, 2023 21:32
Copy link
Collaborator

@mgallien mgallien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comment
somehow missed that earlier, sorry

@m7913d m7913d force-pushed the ignoredFilesExcludedPinState branch 2 times, most recently from 867d468 to 4bd4c02 Compare July 19, 2023 09:47
@m7913d m7913d requested a review from mgallien July 19, 2023 09:49
@mgallien mgallien enabled auto-merge July 20, 2023 11:44
m7913d and others added 3 commits July 20, 2023 13:44
Setting PinState to Excluded ensures the syncing icon is not shown for ignored items.
If the PinState is not set to Excluded, also all parent directories are shown as being synced, which is very inconvenient for the end user as it seems that some folder are never fully synced by Nextcloud which isn't the case.
As long as .lnk files are not converted to placeholder files, also set them to Excluded to hide the syncing icon.

Closes nextcloud#5524
Closes nextcloud#5594

Co-authored-by: Matthieu Gallien <[email protected]>
Signed-off-by: Dries Mys <[email protected]>
F.ex. Folder::slotWatchedPathChanged calls this function on non-
placeholder files to check if the ignored file is already assigned an
Excluded pin state. Note that it is allowed to set the pin state to
Excluded on non-placeholder files.

Signed-off-by: Dries Mys <[email protected]>
@mgallien mgallien force-pushed the ignoredFilesExcludedPinState branch from 4bd4c02 to 55f27cd Compare July 20, 2023 11:44
@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-5853-55f27cdb9657eb53aed0f87f533ff1cd1611d98f-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@mgallien mgallien disabled auto-merge July 20, 2023 13:01
@mgallien mgallien merged commit 759c2a2 into nextcloud:master Jul 20, 2023
9 of 10 checks passed
@mgallien mgallien added this to the 3.10.0 milestone Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants