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

[BUG] Bot Token Expires and Doesn't Reset on Re-Auth #48

Open
3 tasks done
jbyman opened this issue Feb 16, 2024 · 1 comment
Open
3 tasks done

[BUG] Bot Token Expires and Doesn't Reset on Re-Auth #48

jbyman opened this issue Feb 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jbyman
Copy link
Contributor

jbyman commented Feb 16, 2024

Describe the bug

Hello, I've been chasing this one down for a bit, and think I found out what's going on.

When the underlying bot token for the triage bot expires (for whatever reason, it's still not entirely clear to me why Slack bot tokens go to account_inactive despite nobody doing anything or being deactivated), the solution is to re-auth. However, it looks like the new token doesn't save in MongoDB, and we still persist the other one.

Requirements (place an x in each of the [ ])**

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

To Reproduce

Steps to reproduce the behavior:

  1. Install the triage bot, persisting token xoxb-{...}
  2. Have the token go to account_inactive – presumably you can deactivate the first user that installed the bot, or in my case it was just a time-based thing I believe
  3. Re-install the bot
  4. See how the old token is still stored in the database, resulting in a persistent broken integration

Expected behavior

The new token should replace the old one in the database

Screenshots

After re-auth:

ERROR processing {redacted}...
Error: An API error occurred: account_inactive

Reproducible in:

package version: 1.0.1
node version: v20.10.0
OS version(s): Mac OS, Heroku

Additional context

N/A

@jbyman jbyman added the bug Something isn't working label Feb 16, 2024
@jbyman
Copy link
Contributor Author

jbyman commented Feb 16, 2024

The workaround is to manually delete the entry in MongoDB Atlas, but ideally would happen without human intervention

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant