Skip to content

[OPS Common SDK] Update Communication Common SDK for Teams Phone Extensibility GA #41219

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

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

cemateia
Copy link
Member

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copy link

github-actions bot commented May 20, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-communication-identity

# PhoneNumberIdentifiers with different asserted_id and anonymous_type=true are equal as raw_id=4:anonymous
assert PhoneNumberIdentifier(
value="+112345556789", asserted_id="20eacaae2768", is_anonymous=True
) != PhoneNumberIdentifier(value="+112345556789", asserted_id="30eacaae2768", is_anonymous=True)
Copy link
Member Author

Choose a reason for hiding this comment

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

@DominikMe , is this behavior what's expected? I see similar behavior for MicrosoftTeamsUserIdentifier.
If 2 phone numbers have different asserted_ids, but they both have is_anonymous = true, the eq function will return true, as we are only checking the raw_id, and in this case, it's the same for both phone numbers, 4:anonymous

Copy link
Member

Choose a reason for hiding this comment

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

Let's not add asserted_id and is_anonymous to the init function, then we shouldn't run into this problem. That two anonymous phone numbers are considered equal is likely okay, unless we make an exception that an anonymous phone number is always considered different, but that's maybe even more unexpected ...

"""
self.properties = PhoneNumberProperties(value=value)

raw_id: Optional[str] = kwargs.get("raw_id")
Copy link
Member Author

Choose a reason for hiding this comment

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

@DominikMe should we consider for the PhoneNumberIdentifier to parse here the raw_id and populate the asserted_id and is_anonymous based on the raw_id?
Or is it supposed to be used just to create the raw_id starting from the properties? There's also the identifier_from_raw_id that I think should generally be used for parsing from raw_id to identifier type

Copy link
Member

Choose a reason for hiding this comment

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

@cemateia Let's follow what we do in the other languages, for example here in C#

=> Don't add asserted_id and is_anonymous to the init args (we can still do that in the future if we must)
=> Inside init, compute asserted_id and is_anonymous based on the raw_id (optionally do it in the properties but probably better to do it in init)
=> in _format_raw_id don't compute the raw_id based on asserted_id and is_anonymous because these two are derived from the raw_id
=> identifier_from_raw_id probably doesn't need changes if asserted_id and is_anonymous get derived within phone number identifier, right?

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.

2 participants