Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.35k stars 4.71k forks source link

[BUG] Unable to remove linked domain #44489

Closed yogeshmo closed 2 months ago

yogeshmo commented 3 months ago

Library name and version

Azure.Communication.Email 1.0.1

Describe the bug

I'm running into an issue with the Communication .NET Management SDK where I'm not able to unlink a domain from a communication services resource.

Expected behavior

"LinkedDomains" is a property under the communication resource, and sending out a patch request with an empty LinkedDomains list should remove any existing linked domains from the resource.

Actual behavior

When using the .NET SDK, It seems like the response from the patch request still contains the linked domain (this should be an empty list).

The response I get back should have an empty list in "LinkedDomains", but it's still contains an item.

image

Adding a LinkedDomain to the list is working fine. I was also able to remove the linked domain with the JS SDK and by directly making an http request, so it seems like the issue is specifically with the .NET SDK. I've also tried setting "LinkedDomains" to null, but that gives me a compilation error.

Reproduction Steps

This is how I'm making the request with the SDK.

CommunicationServiceResourcePatch patch = new CommunicationServiceResourcePatch
{
    LinkedDomains = { }
};
CommunicationServiceResource result = await communicationServiceResource.UpdateAsync(patch);

Environment

No response

github-actions[bot] commented 3 months ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

github-actions[bot] commented 3 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @acsdevx-msft.

ArthurMa1978 commented 3 months ago

Hey @yogeshmo , as we discussed in teams, please confirm with logging / fiddler that the payload contains

"linkedDomains": []

If so then the client is doing the right thing and I would start to look at the service side. if not then I would break on this line here https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourcePatch.Serialization.cs#L49 .
The first part of that check is whether or not the underlying instance of LinkedDomains is a ChangeTrackingList which with the way you are constructing it in issue linked in this thread it should not be as you are instantiating it with { } .

github-actions[bot] commented 3 months ago

Hi @yogeshmo. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

github-actions[bot] commented 2 months ago

Hi @yogeshmo, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!