Skip to content

Comments

Refactor unregister sync root#191

Merged
dajimenezriv-internxt merged 27 commits intomasterfrom
refactor-unregister-sync-root
Sep 17, 2025
Merged

Refactor unregister sync root#191
dajimenezriv-internxt merged 27 commits intomasterfrom
refactor-unregister-sync-root

Conversation

@dajimenezriv-internxt
Copy link
Contributor

No description provided.

@dajimenezriv-internxt dajimenezriv-internxt self-assigned this Sep 15, 2025
@dajimenezriv-internxt dajimenezriv-internxt changed the title Commt Refactor unregister sync root Sep 16, 2025
Base automatically changed from extract-get-registered-sync-roots to master September 17, 2025 14:59

try {
return fn(env, info);
} catch (const winrt::hresult_error& e) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Improve it to handle windows cloud api errors so we can print correctly the errors.

auto contextBuffer = info.Context();
if (contextBuffer) {
sr.context = winrt::CryptographicBuffer::ConvertBinaryToString(winrt::BinaryStringEncoding::Utf8, contextBuffer).c_str();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We no longer need the context of the cloud provider since now we are filtering by the displayName and path.

syncRootIdentity.append(providerName);

winrt::IBuffer contextBuffer = winrt::CryptographicBuffer::ConvertStringToBinary(syncRootIdentity, winrt::BinaryStringEncoding::Utf8);
info.Context(contextBuffer);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As said, we were adding the context when registering the cloud provider to filter later, however now we filter using the displayName and path.

@@ -0,0 +1,19 @@
#include <windows.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new unregister. Basically now we don't care if it's an uuid, the "syncRoot" text or whatever. We assume that was javascript sends here is a existing sync root, which it should.

@dajimenezriv-internxt dajimenezriv-internxt merged commit 5a0680d into master Sep 17, 2025
1 check passed
@dajimenezriv-internxt dajimenezriv-internxt deleted the refactor-unregister-sync-root branch September 17, 2025 16:31
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.

2 participants