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

Ensure Connector Client is retrieved in teams_info.py #2062

Merged
merged 5 commits into from
Jan 26, 2024
Merged

Ensure Connector Client is retrieved in teams_info.py #2062

merged 5 commits into from
Jan 26, 2024

Conversation

InfinytRam
Copy link
Contributor

Fixes #2061

@InfinytRam InfinytRam requested a review from a team as a code owner January 21, 2024 21:39
@InfinytRam
Copy link
Contributor Author

@microsoft-github-policy-service agree

@@ -318,10 +318,18 @@ def get_team_id(turn_context: TurnContext):

@staticmethod
async def _get_connector_client(turn_context: TurnContext) -> ConnectorClient:
return await turn_context.adapter.create_connector_client(
turn_context.activity.service_url
if hasattr(turn_context.adapter, 'create_connector_client'):
Copy link
Member

Choose a reason for hiding this comment

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

I'm not convinced this is required. JS appears to take some streaming concerns into mind. Does this work with just getting the ConnectorClient from TurnState as DotNet does?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Indeed it does work with just getting the ConnectClient from TurnState.

Though, I encountered a failure in the test_on_teams_members_added_activity test case. To fix it, I implemented a mock ConnectorClient using the SimpleAdapter. What do you think?

@tracyboehrer tracyboehrer merged commit 489d547 into microsoft:main Jan 26, 2024
2 checks passed
@InfinytRam InfinytRam deleted the connector-client-retrieval branch January 26, 2024 15:47
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.

CloudAdapter' object has no attribute 'create_connector_client'
3 participants