Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[DRAFT] [WIP] Add in builtin listener for token revoked and app uninstalled events #2337
base: main
Are you sure you want to change the base?
[DRAFT] [WIP] Add in builtin listener for token revoked and app uninstalled events #2337
Changes from 1 commit
011fcd4
a6491ac
f4fa2d3
7f70036
6b549f0
d19f686
bf058dc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check failure on line 23 in src/listener/builtin.ts
GitHub Actions / examples (20.x, examples/custom-receiver)
Check failure on line 23 in src/listener/builtin.ts
GitHub Actions / examples (18.x, examples/custom-receiver)
Check failure on line 23 in src/listener/builtin.ts
GitHub Actions / examples (20.x, examples/getting-started-typescript)
Check failure on line 23 in src/listener/builtin.ts
GitHub Actions / build (20.x)
Check failure on line 23 in src/listener/builtin.ts
GitHub Actions / examples (18.x, examples/getting-started-typescript)
Check failure on line 23 in src/listener/builtin.ts
GitHub Actions / build (22.x)
Check failure on line 23 in src/listener/builtin.ts
GitHub Actions / build (18.x)
Check failure on line 23 in src/listener/builtin.ts
GitHub Actions / examples (22.x, examples/custom-receiver)
Check failure on line 23 in src/listener/builtin.ts
GitHub Actions / examples (22.x, examples/getting-started-typescript)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seratch wrote this while referencing the Python and Java PRs, wanted to see if these functions / this class was on the right track for what we're trying to accomplish.
I did notice that Java and Python have a
delete_bot
function in the installationStore that Bolt JS doesn't seem to have - does the bot get deleted automatically upontoken_revoked
andapp_uninstalled
events in Bolt JS, or will I have to manually delete the bot? (ex: https://github.com/seratch/bolt-python/blob/2ab87ee4111554d2b3d3ca517294211fdb0ce963/slack_bolt/listener/builtins.py#L26)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two approaches:
[Aligning with bolt-java/python]
Aligning with bolt-python/java should be the safest, most clear, and flexible approach:
Review https://github.com/slackapi/bolt-python/blob/v1.21.2/slack_bolt/listener/builtins.py to better understand why bolt-python/java have three methods.
I don't believe this can cause any confusion. If a developer has already implemented the deleteInstallation method, bolt-js never calls the method without a user_id, so adding built-in support should not break anything.
When we release this built-in listener support, we should mention the necessity of two more method implementation, though.
[Opting for a simpler but more inflexible approach]
If we try to only use deleteInstallation, the method can function in the following ways:
This approach should also work, but the downside is that when an app does not want to delete user tokens while deleting a bot token, deleteInstallation with enterprise/team_id does not behave this way.
While Bolt supports user-token-only use cases, we generally recommend having a bot token to enable many functionalities. Deleting a bot token usually means the app is no longer being used in the workspace. So, deleting all tokens when a bot token is revoked makes sense to many apps. With that being said, this inflexibility may limit developers options. Also, our platform intentionally provides two event types to differentiate the scenarios a single token revocation vs app uninstallation.
I recommend [Aligning with bolt-java/python], but am open to any alternatives including the second option here. @filmaj do you have any option on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seratch Personally I like the first option! Does this mean to proceed with the first option, we'll need to release a new
@slack/oauth
version with the interface for InstallationStore updated to include a deleteBot and deleteAll optional method, similar to the Python implementation?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hello-ashleyintech yes, you're right!
Check failure on line 37 in src/listener/builtin.ts
GitHub Actions / examples (20.x, examples/custom-receiver)
Check failure on line 37 in src/listener/builtin.ts
GitHub Actions / examples (18.x, examples/custom-receiver)
Check failure on line 37 in src/listener/builtin.ts
GitHub Actions / examples (20.x, examples/getting-started-typescript)
Check failure on line 37 in src/listener/builtin.ts
GitHub Actions / build (20.x)
Check failure on line 37 in src/listener/builtin.ts
GitHub Actions / examples (18.x, examples/getting-started-typescript)
Check failure on line 37 in src/listener/builtin.ts
GitHub Actions / build (22.x)
Check failure on line 37 in src/listener/builtin.ts
GitHub Actions / build (18.x)
Check failure on line 37 in src/listener/builtin.ts
GitHub Actions / examples (22.x, examples/custom-receiver)
Check failure on line 37 in src/listener/builtin.ts
GitHub Actions / examples (22.x, examples/getting-started-typescript)