Skip to content

Conversation

@ram-xv
Copy link
Contributor

@ram-xv ram-xv commented Jan 21, 2024

Fixes #2061

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

ram-xv commented Jan 21, 2024

@microsoft-github-policy-service agree

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
@ram-xv ram-xv 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