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

Sending activity onBehalfOf does not resolve to a user #4788

Open
tomoyasoon opened this issue Nov 6, 2024 · 2 comments
Open

Sending activity onBehalfOf does not resolve to a user #4788

tomoyasoon opened this issue Nov 6, 2024 · 2 comments
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository.

Comments

@tomoyasoon
Copy link

tomoyasoon commented Nov 6, 2024

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Versions

botbuilder": "^4.20.0
node v18.20.3
Google Chrome Version 129.0.6668.101, Firefox 131.0.3 (aarch64)
macOS 14.3 (23D56)

Describe the bug

We are sending an activity to a conversation. We want to use the onBehalfOf feature, so we append the appropriate properties (see the code snippet below). The config.onBehalfOf.oid is the oid of the trusted MicrosoftAADUser who triggers this action. We tested this with different users and the mri never got resolved and we always end up using the displayName as a fallback. We assume that the construction of the mri is correct, but also tried variants which only used config.onBehalfOf.oid as a value.

Question is: Is the construction of the mri correct? ("8:orgid:...) This worked a few months ago, so we assume it is either broken or a change happened, which we are not aware of.

let card = CardFactory.adaptiveCard(issueWithCard.card);

let activity: Partial<Activity> = MessageFactory.attachment(card);
if (config.onBehalfOf) {
	activity.channelData = {
		onBehalfOf: [{
			itemid: 0,
			mentionType: "person",
			mri: "8:orgid:" + config.onBehalfOf.oid,
			displayName: config.onBehalfOf.displayName
		}]
	};
}

let rootCardMessage = await client.conversations.sendToConversation(config.channelId, activity);

To Reproduce

Steps to reproduce the behavior:

  1. Send an activity using the sendToConversation function. Set onBehalfOf accordingly.
  2. Go to the conversation in Teams.
  3. Check if the message sender got resolved by onBehalfOf.mri or if the fallback is being used (displayName).

Expected behavior

We expect that the user's oid is being resolved and used by displaying the message including the onBehalfOf feature.

@tomoyasoon tomoyasoon added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Nov 6, 2024
@dmvtech
Copy link
Collaborator

dmvtech commented Nov 14, 2024

Hi @tomoyasoon

  1. See error

Is there an actual error message? Or the error is just that the mri doesn't get resolved?

@dmvtech dmvtech added customer-reported Issue is created by anyone that is not a collaborator in the repository. Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. and removed needs-triage The issue has just been created and it has not been reviewed by the team. labels Nov 14, 2024
@tomoyasoon
Copy link
Author

Hi @dmvtech

There is no error message, I'll adjust my description accordingly - it is indeed the case, that the mri does not get resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository.
Projects
None yet
Development

No branches or pull requests

2 participants