fix: order of arguments when calling ConnectorClient.getConversationMember in TeamsInfo.getMemberInternal #593
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR is a simple swap of the arguments passed to the
connectorClient.getConversationMember
call within theTeamsInfo.getMemberInternal
function so that the correct url is formed.Problem
When calling
TeamsInfo.getMember(context, userId)
, I was getting a 400 error from the API call. Upon inspecting the url, we found that the url path being used took on the form:But it should take the form:
Solution
We found that the arguments being passed into
connectorClient.getConversationMember
were swapped when called withinTeamsInfo.getMemberInternal
. With a simple swap insideTeamsInfo.getMemberInternal
, the api call takes on the correct form.The other solution would be switching the arguments at the
ConnectorClient.getConversationMember
implementation level like so:Since this would require anyone currently using a direct call to
ConnectorClient.getConversationMember
to swap them around, I figured the solution I chose was less disruptive.However, the
TeamsConnectorClient.getConversationMember
function uses what looks to be the preferred(conversationId: string, userId: string)
argument structure so it can be confusing. Feel free to change the implementation if that solution isn't as disruptive as I first thought.