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

403 User Blocked Bot Error Unexpected #6655

Open
14 tasks
mcat97 opened this issue Jul 18, 2024 · 4 comments
Open
14 tasks

403 User Blocked Bot Error Unexpected #6655

mcat97 opened this issue Jul 18, 2024 · 4 comments
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not remove. 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

@mcat97
Copy link

mcat97 commented Jul 18, 2024

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

Version

4.21.4

Describe the bug

  1. Our test user has mysteriously had the bot blocked, despite no one ever having blocked it before. We didn't know it was a thing. Other developers have nuked their local bot in order to get beyond this issue, but never understood how the user came to have the bot blocked.
  2. Since the above happened, we noticed upon sending an adaptive card, using the method Member_2.sendAdaptiveCard with no errorHandler passed in for onError, we get a 403 User blocked the conversation with the bot. Of course, this is expected as we now are purposely blocking the bot to test sending cards. However, what we do not understand is why when someone has the bot blocked, the 403 causes the bot to entirely crash and send the pre-fabbed User blocked the conversation with the bot messages to the channel the bot is in. We cannot find documentation to help us better understand how to elegantly handle this error.

To Reproduce

Steps to reproduce the behavior:

  1. Install the Microsoft Teams bot to a Channel -- i.e. "General".
  2. Have "User A" in this specific General Channel
  3. Have "User A" block the bot you installed in the General Channel (done via triple dot menu in the chat tab, after messaging the bot directly)
  4. Have your installed Microsoft Teams Bot send an adaptive card using the method member.sendAdaptiveCard (i.e. Member_2.sendAdpativeCard)

Expected behavior

Upon completing the reproduction steps, you should see your bot sends 2 messages to the "general channel" (a message of the error, and a message to fix the source code) and produces an "unhandled error" within your console.

What we expect to happen:
Give a clear and concise description of what you expected to happen.
We expect the message to not send, but we do not expect the bot to crash and be told the error is unhandled.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.
If someone could help us understand if there are any other ways a bot ends up blocked by a user without using the triple dot menu in the chat section, it would help us write documentation for our end users. Additionally, examples and documentation on how to better and more elegantly handle the 403 error would be extremely appreciated. Apologies in advance if this isn't there this isn't meant to go, but after a few conversations we feel the two scenarios scream more like a potential bug than a stack overflow issue.

Tracking Status

Dotnet SDK TODO

  • PR
  • Merged

Javascript SDK TODO

  • PR
  • Merged

Python SDK TODO

  • PR
  • Merged

Java SDK TODO

  • PR
  • Merged

Samples TODO

  • PR
  • Merged

Docs TODO

  • PR
  • Merged

Tools TODO

  • PR
  • Merged
@mcat97 mcat97 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 Jul 18, 2024
@dmvtech
Copy link
Collaborator

dmvtech commented Jul 19, 2024

I assume this is in Microsoft Teams? And that this issue is the same?

Can you please give more information about the repro steps? I assume when you say "to the channel the bot is in", you mean a Teams channel (not to be confused with a Bot channel such as Teams or Telegram).

@dmvtech dmvtech self-assigned this Jul 19, 2024
@dmvtech dmvtech added 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. Bot Services Required for internal Azure reporting. Do not remove. Do not change color. and removed needs-triage The issue has just been created and it has not been reviewed by the team. labels Jul 19, 2024
@mcat97
Copy link
Author

mcat97 commented Jul 22, 2024

I assume this is in Microsoft Teams? And that this issue is the same?

Can you please give more information about the repro steps? I assume when you say "to the channel the bot is in", you mean a Teams channel (not to be confused with a Bot channel such as Teams or Telegram).

Yes those issues are the same.

Regarding the reproduction steps, I will go in and add detail where I can (however there isn't much to it, so forgive me and let me know what you feel you are missing if there is anything). In reference to "to the channel the bot it in", correct, I mean the Microsoft Teams Channel the bot was installed in.

@dmvtech
Copy link
Collaborator

dmvtech commented Jul 23, 2024

  1. Have "User A" in this specific General Channel
  2. Have "User A" block the bot you installed in the General Channel

I'm not able to accomplish this part (in my environment). I don't seem to have the option to block the bot in a channel. Would you happen to know if there are specific permissions needed to get that option?

Additionally; how are they blocking it? Are they doing that from the ellipsis when hovering over the bot in a channel? Please give more info on exact steps to block the bot.

I know that to block a bot in a 1:1 conversation, you can click on the bot and select Block bot converstation. Not sure how to from within a channel.

@mcat97
Copy link
Author

mcat97 commented Jul 23, 2024

I'm not able to accomplish this part (in my environment). I don't seem to have the option to block the bot in a channel. Would you happen to know if there are specific permissions needed to get that option?

There should not be any permissions to need to block the bot. If the bot has posted in the channel (like a welcome message, as ours does), message the bot and then block it from the chat side menu
SCR-20240723-kosf
SCR-20240723-kpdn

Additionally; how are they blocking it? Are they doing that from the ellipsis when hovering over the bot in a channel? Please give more info on exact steps to block the bot.

Please see above

I know that to block a bot in a 1:1 conversation, you can click on the bot and select Block bot converstation. Not sure how to from within a channel.

You cannot block the bot from the channel, when I mention blocking the bot in the channel you installed, I was just providing extra detail to specify which bot to block, not to do the blocking within the channel. Apologies for any confusion.

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 remove. 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