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

Slack setup doesn't work if channels cache was recently cleared #23251

Closed
noahmoss opened this issue Jun 9, 2022 · 2 comments · Fixed by #23253
Closed

Slack setup doesn't work if channels cache was recently cleared #23251

noahmoss opened this issue Jun 9, 2022 · 2 comments · Fixed by #23253
Assignees
Labels
Notifications/Slack Priority:P2 Average run of the mill bug .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Type:Bug Product defects
Milestone

Comments

@noahmoss
Copy link
Member

noahmoss commented Jun 9, 2022

Describe the bug
A slack channels cache was added in #20570 to improve performance. The cache is only refreshed if it was not refreshed within the last 10 minutes. It is also cleared whenever a Slack token is deleted. This means that if you've deleted a Slack app within the last 10 minutes, you can't add a new one, because the cache will be empty and the check that the files channel exists will fail.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Slack integration in Metabase using the instructions in the admin panel
  2. Delete the Slack integration
  3. Add the Slack integration again
  4. See a "channel not found" error on save, even though the files channel exists

Information about your Metabase Installation:
Current master

Severity
p1/2? only workaround is to wait 10 minutes and try again

@noahmoss noahmoss added Type:Bug Product defects .Needs Triage .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. labels Jun 9, 2022
@dpsutton
Copy link
Contributor

dpsutton commented Jun 9, 2022

@noahmoss Do we not populate the channel cache when saving a new token? The empty cache remains empty until its scheduled refresh?

@flamber flamber added Priority:P2 Average run of the mill bug Notifications/Slack and removed .Needs Triage labels Jun 9, 2022
@noahmoss
Copy link
Member Author

noahmoss commented Jun 9, 2022

@dpsutton The issue is that there's a function that checks whether the cache was updated within the last 10 minutes. We try to update it when a new token is saved, but if that check returns false, we skip it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Notifications/Slack Priority:P2 Average run of the mill bug .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants