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

Fix VFS CfAPI Syncroot Register Error. #3043

Merged
merged 1 commit into from
Mar 27, 2021

Conversation

allexzander
Copy link
Contributor

Signed-off-by: allexzander [email protected]

@allexzander
Copy link
Contributor Author

Found the reason for the CfAPI wrapper to fail the Sync Root registration when using a build from the installer. Weird, but, this is caused by passing parameters by reference between different libraries. This problem appeared after adding a few more such parameters.

@allexzander allexzander merged commit 4ce2e79 into master Mar 27, 2021
@allexzander allexzander deleted the bugfix/vfs-syncroot-register-error branch March 27, 2021 00:44
@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-3043-28771b25e371f032e2c953b50e34bde7ba922f92-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.

@FlexW
Copy link

FlexW commented Mar 27, 2021

@allexzander Weird. Which libraries do you mean? Because registerSyncRoot() is just called in vfs_cfapi.cpp:66 which is also part of libsync. The only place where (in this part of the application) functions are called across dll boundaries is OCC::Utility::registrySetKeyValue(), OCC::Utility::registryGetKeyValue, OCC::Utility::registryDeleteKeyTree() and OCC::Utility::registryKeyExists(). Is it possible that we somehow do not export the functions correct?

@allexzander
Copy link
Contributor Author

@FlexW Indeed, this could be the case, the weird thing is:

  • the issue only happens when running a build from the "C:/Program Files" folder (confirmed this with multiple tests)
  • the issue does not happen when using the X86 MSI (I guess it's the one you've been using)
  • the issue only appeared after adding enough of reference-passed arguments

@allexzander
Copy link
Contributor Author

@FlexW Well, I must add some edits to my previous comment. Unfortunately, this is due to "libsync" is a separate library, while, the GUI (where folder.cpp) resides, is not. If you look closely, the "folder.cpp" is not separated from the rest of the code and it gets built into .exe. While, "libsync" on the other hand, is a separate ".dll". So, yeah, the problem appears on the boundary between "libsync" and the rest of the code. It is not in the OCC::Utility.

Also, the failure happens when calling CfRegisterSyncRoot function, which is not related to registry values. Besides that, the Registry values always set successfully (confirmed by logging and checking the Registry contents after launching the client).

@allexzander
Copy link
Contributor Author

@er-vin Any thoughts on this?

@er-vin
Copy link
Member

er-vin commented Mar 29, 2021 via email

@allexzander
Copy link
Contributor Author

@er-vin Indeed. This workaround, is, of course, is a temporary solution. Just to make us stick to the release plan. Frankly speaking, I never expected the Progress Bar feature to fail at this specific place. Everything looked fine. I'll be digging into a root cause later this week. And yes, the only DLL boundary we have right now is between GUI and libsync.

@er-vin
Copy link
Member

er-vin commented Mar 29, 2021 via email

@allexzander
Copy link
Contributor Author

@er-vin Yes. I learned a lesson. Yet, I doubt this would get caught during the review. It's so subtle. And is not happening on every Windows OS build (surprisingly :)).

@er-vin
Copy link
Member

er-vin commented Mar 29, 2021 via email

@er-vin
Copy link
Member

er-vin commented Mar 29, 2021

Note that, if the progress is giving too much trouble, you still have the option to revert the merge commit which introduced it. That's mainly why the rebase + merge approach was introduced, taking a feature out of master is supposedly only a merge commit to revert. Might be a bit more complicated now due to the couple of "test PRs" which now pollute the history. But sometimes it's just better to make a step back to come better prepared later.

@allexzander
Copy link
Contributor Author

Note that, if the progress is giving too much trouble, you still have the option to revert the merge commit which introduced it. That's mainly why the rebase + merge approach was introduced, taking a feature out of master is supposedly only a merge commit to revert. Might be a bit more complicated now due to the couple of "test PRs" which now pollute the history. But sometimes it's just better to make a step back to come better prepared later.

@er-vin Been thinking about that at the very beginning when the issue started to happen. But now, the temporary solution seems safe for now, so reverting everything will just bring more bad than good at this point.

@er-vin
Copy link
Member

er-vin commented Mar 30, 2021 via email

@er-vin
Copy link
Member

er-vin commented Mar 30, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants