fix(slack): Send linking message in bot <> user DM if bot doesn't have access to channel
fixes SENTRY-3BTE
the bot was attempting to send an ephemeral message in a channel that it doesn't have access to, which is why slack was sending us channel_not_found.
the solution here is if we can't send the ephemeral message, we instead send the user a dm to link their identity. because sending them a link to their message would be another slack api call, i instead settled on sending them the channel that they decided to send the link in, so they can jump to it.
Should we consider implementing some sort of debounce or opt out for this? I could see this becoming obnoxious for a user who doesn't want to link their slack identity.
Codecov Report
Attention: Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
:white_check_mark: All tests successful. No failed tests found.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/sentry/integrations/slack/webhooks/event.py | 33.33% | 4 Missing :warning: |
:x: Your patch status has failed because the patch coverage (66.66%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files
@@ Coverage Diff @@
## master #77030 +/- ##
=======================================
Coverage 78.22% 78.23%
=======================================
Files 6900 6902 +2
Lines 306762 306825 +63
Branches 50283 50290 +7
=======================================
+ Hits 239975 240037 +62
Misses 60428 60428
- Partials 6359 6360 +1
This pull request has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀