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

Implement File Provider file synchronisation engine for macOS #5527

Merged
merged 332 commits into from
May 12, 2023

Conversation

claucambra
Copy link
Collaborator

@claucambra claucambra commented Mar 15, 2023

This PR properly implements virtual files on macOS by implementing a sync engine using Apple's FileProvider framework.

Screenshot 2023-03-15 at 13 14 32

Closes #1337

@claucambra claucambra self-assigned this Mar 15, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ clang-tidy found issue(s) with the introduced code (1/2)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ clang-tidy found issue(s) with the introduced code (2/2)

@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Merging #5527 (23855a1) into master (9b77da6) will decrease coverage by 0.16%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5527      +/-   ##
==========================================
- Coverage   59.35%   59.20%   -0.16%     
==========================================
  Files         143      143              
  Lines       18461    18469       +8     
==========================================
- Hits        10958    10934      -24     
- Misses       7503     7535      +32     
Impacted Files Coverage Δ
src/libsync/configfile.cpp 25.68% <0.00%> (-0.34%) ⬇️

... and 5 files with indirect coverage changes

src/gui/application.cpp Outdated Show resolved Hide resolved
src/gui/macOS/fileprovider_mac.mm Show resolved Hide resolved
src/gui/macOS/fileprovider.h Outdated Show resolved Hide resolved
src/gui/macOS/fileprovidersocketserver.h Outdated Show resolved Hide resolved
src/gui/macOS/fileprovidersocketserver.h Outdated Show resolved Hide resolved
src/gui/macOS/fileprovidersocketserver.h Show resolved Hide resolved
src/gui/macOS/fileproviderdomainmanager.h Outdated Show resolved Hide resolved
return domainIdentifierForAccount(account.get());
}

QString domainDisplayNameForAccount(const OCC::Account * const account)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not OCC::AccountPtr ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We do have one with OCC::AccountPtr but for convenience, we can just overload rather than having to do the conversion each time depending on what we receive

Copy link
Collaborator

Choose a reason for hiding this comment

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

so the question becomes why do you handle raw Account pointers instead of using OCC::AccountPtr ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because this is what we receive from the Account/PushNotification signals:

Pushnotifications:

void filesChanged(OCC::Account *account);

Account:

    void pushNotificationsReady(OCC::Account *account);

Copy link
Collaborator

Choose a reason for hiding this comment

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

the I would say push an extra commit that is changing

emit pushNotificationsReady(this);

to

emit pushNotificationsReady(sharedFromThis());

the current API is confusing because we mix AccountPtr and Account*
someone is going to be confused when reading this code (and yes I was)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would say this is out of scope as it affects some other parts of the client -- I'll open a new PR with these changes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I opened #5543 for this

Note to self: adjust to changes once merged

CMakeLists.txt Outdated Show resolved Hide resolved
@claucambra claucambra force-pushed the feature/file-provider-try-2 branch from 857df97 to 80831a4 Compare March 15, 2023 15:10
@claucambra claucambra requested a review from mgallien March 15, 2023 15:34
@claucambra claucambra force-pushed the feature/file-provider-try-2 branch 14 times, most recently from 063754f to b4d8290 Compare March 20, 2023 15:09
@claucambra claucambra force-pushed the feature/file-provider-try-2 branch from 3ac84ea to bd1ae98 Compare March 21, 2023 15:32
src/gui/application.cpp Outdated Show resolved Hide resolved
src/gui/macOS/fileprovider.h Show resolved Hide resolved
src/gui/macOS/fileproviderdomainmanager.h Outdated Show resolved Hide resolved
src/gui/macOS/fileproviderdomainmanager.h Outdated Show resolved Hide resolved
return domainIdentifierForAccount(account.get());
}

QString domainDisplayNameForAccount(const OCC::Account * const account)
Copy link
Collaborator

Choose a reason for hiding this comment

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

the I would say push an extra commit that is changing

emit pushNotificationsReady(this);

to

emit pushNotificationsReady(sharedFromThis());

the current API is confusing because we mix AccountPtr and Account*
someone is going to be confused when reading this code (and yes I was)

@claucambra claucambra requested a review from mgallien March 22, 2023 14:34
@sonarcloud
Copy link

sonarcloud bot commented May 12, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@claucambra claucambra merged commit c4d1211 into master May 12, 2023
@claucambra claucambra deleted the feature/file-provider-try-2 branch May 12, 2023 09:05
@berezovskyi
Copy link

Thank you for this feature, been waiting for it eagerly! 🎉 🕺 💃

Where do we find the relevant macOS builds and what requirements does it put on the server version, please? Or is switching to the beta channel on the Desktop app enough?

@claucambra
Copy link
Collaborator Author

claucambra commented May 15, 2023

Thank you for this feature, been waiting for it eagerly! 🎉 🕺 💃

Glad to hear it! :)

Where do we find the relevant macOS builds and what requirements does it put on the server version, please?

Check the linked issue thread, there is a link to download a beta build in the announcement post

Or is switching to the beta channel on the Desktop app enough?

No, this module will not be provided in the beta builds under major version 3.8, but it will now be part of the daily builds

Still, we recommend the use of the beta build linked above for now. I'm working on releasing a second beta with additional improvements and bugfixes soon :)

claucambra added a commit that referenced this pull request Jun 6, 2023
…-try-2"

This reverts commit c4d1211, reversing
changes made to 9b77da6.
claucambra added a commit that referenced this pull request Jun 6, 2023
…-try-2"

This reverts commit c4d1211, reversing
changes made to 9b77da6.

Signed-off-by: Claudio Cambra <[email protected]>
claucambra added a commit that referenced this pull request Jun 7, 2023
…-try-2"

This reverts commit c4d1211, reversing
changes made to 9b77da6.

Signed-off-by: Claudio Cambra <[email protected]>
claucambra added a commit that referenced this pull request Jun 7, 2023
…-try-2"

This reverts commit c4d1211, reversing
changes made to 9b77da6.

Signed-off-by: Claudio Cambra <[email protected]>
@core-code
Copy link

please tell me there is a way to turn this off! we just switched away from Dropbox because the integration with the native macOS cloud API makes it completely unusable.

@Freshou
Copy link

Freshou commented Jun 13, 2023

Here : https://github.com/nextcloud/desktop/releases

it say it have been implemented in version 3.9 ...

But I see nothing to activate Sync with File Provider ...

Did I missed a step to activate it ???

And yes I added macFileProviderModuleEnabled=True to nextcloud.cfg ....

@berezovskyi
Copy link

@Freshou it seems to have been reverted without explanation: #5772

@misku
Copy link

misku commented Jun 13, 2023

@claucambra could we ask why the feature was removed from 3.9?
The log is a bit confusing at the moment:

@core-code
Copy link

And yes I added macFileProviderModuleEnabled=True to nextcloud.cfg ....

does that mean i can macFileProviderModuleEnabled=False to prevent this from ever becoming enabled?

@BJKle
Copy link

BJKle commented Jun 16, 2023

@claucambra If it has been disabled or even removed from 3.9, is there a target release?
Thank you

@claucambra
Copy link
Collaborator Author

claucambra commented Jun 16, 2023

We have unfortunately had to remove the File Provider module from 3.9 due to a major regression which broke the Finder Sync extension.

We will instead be releasing a further macOS VFS beta with additional improvements and bugfixes as we continue to work on this.

Our target stable release for a stable File Provider module will be 3.10; in the mean time, expect more VFS betas :)

@BJKle
Copy link

BJKle commented Jun 16, 2023

Thanks for the update

claucambra added a commit that referenced this pull request Jul 3, 2023
@mgallien mgallien added this to the 3.9.0 milestone Jul 4, 2023
@BJKle
Copy link

BJKle commented Aug 7, 2023

Hi, ist there any update on a future release or beta? This feature is so nice on a windows PC and I really miss it on MacOS.

@usethevibe
Copy link

Hi evevryone! are there news??

@ghost
Copy link

ghost commented Sep 1, 2023

Any updates?

@m-emelchenkov
Copy link

Don't get me wrong, I don't want to be negative. But if it will be ready anytime soon, don't expect much. Tens and tens of thousands of files (i.e. for real-time sync any Node projects and Git repositories) can't handle any existing software on the market with FileProvide API support: Synology Drive, Resilio Connect, StrongSync, SeaDrive, OneDrive for Business. I tried a lot of software and I can indirectly guess two problems: a) issues with FileProvider API itself — simply works not very good, b) issues with dev. teams — they simply can't program big workloads well, lack of expertise. So, I doubt Nextcloud can change current landscape, but wish them all luck.

@core-code
Copy link

So, I doubt Nextcloud can change current landscape, but wish them all luck.

thats why the only thing i am interested here is whether there will be a way to turn if off when this lands.

@BJKle
Copy link

BJKle commented Sep 13, 2023

We have unfortunately had to remove the File Provider module from 3.9 due to a major regression which broke the Finder Sync extension.

We will instead be releasing a further macOS VFS beta with additional improvements and bugfixes as we continue to work on this.

Our target stable release for a stable File Provider module will be 3.10; in the mean time, expect more VFS betas :)

@claucambra
Is that still true. It looks like 3.10 will be released soon, which is great news.
Where can I find the necessary documentation?

@claucambra
Copy link
Collaborator Author

claucambra commented Nov 13, 2023

So, I doubt Nextcloud can change current landscape, but wish them all luck.

thats why the only thing i am interested here is whether there will be a way to turn if off when this lands.

There will be a separate release explicitly with File Provider sync. We have no plans to replace the conventional sync client

@gnordli
Copy link

gnordli commented Nov 13, 2023

Hi. Are you targeting this for 3.11 now?
thanks,
Geoff

@Sidirius
Copy link

Any updates on this?
Is there a planned target?

@jackbeeby
Copy link

Any updates or release? Possibly a beta?

@claucambra
Copy link
Collaborator Author

This has already shipped, see #6656 :)

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.

Support FileProvider API (VFS) in macOS