-
Notifications
You must be signed in to change notification settings - Fork 662
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
Installation does not model situations where multiple Incoming Webhooks are created in a single workspace/organization #1122
Comments
Thanks for bringing a great topic to discuss!
In my opinion, an Having all available incoming webhooks in a single installation data (as suggested here) means merging multiple installation data rows into one row in a database. Doing so will bring more complexity to the SDKs, plus, will make implementing valid custom installation stores harder. Here is one example database table that stores historical data of all installations in Python SDK. https://github.com/slackapi/python-slack-sdk/blob/v3.0.0/slack_sdk/oauth/installation_store/sqlite3/__init__.py#L55-L72 With this database table design, appending a new row for each installation is recommended over updating a single installation in the table. In my understanding, the general recommendation for implementing the storage layer for So, my comments/suggestions here are:
In this case, the method name should be Overall, I don't see the necessity to change |
Great points about the utility of having a historical record of individual installations! I see a lot of value there and would like to preserve that too. In my view, Therefore I believe the In order to understand which authorization info is the best we must consider all of the installations which match the query (team ID, enterprise ID, user ID, conversation ID), right? I had hoped that our library could just fetch a single But still, I'd like to save our developers the effort of having to describe the complex choice of which authorization info is best. I think if we were to update the What do you think about this? |
In the case of bot tokens, this is quite simple. The latest one is always the right one. That's one of the reasons why I recommend having a kind of bots table for a bot token and its associated data in Python and Java. In the case of installations, that depends and queries may not be so simple as you mentioned.
I may not fully understand what the situation you mentioned yet. Are you assuming a situation as below?
If so, I'm not sure what When it comes to Events API handling, you don't need to worry about it. In the case where the same app is installed in both sides (or multiple workspaces/orgs) in a shared channel, your app does not receive doubled/multiplied events (I'm sure about this at least for message events). Consistently, one bot user in a particular workspace behaves there. If you are specifically talking about
This sounds ... very confusing to me. Also, it's impossible to follow this design in an idiomatic way in Java. In Python, the Regarding the last paragraph, I think developers can set additional fields in
Or, just allowing developers to have any additional fields in |
Yup, that was the situation I was using as an example. I admit, the example is a little contrived. But the general problem here is pretty easy to state: If the framework/library already needs to query the By extension, its also wasteful to throw away other candidate installations when several are matching the query, because the fetch for one or a small set will likely cost about the same (it might even cost slightly more in some cases to sort by latest and limit 1 than to return the full result). The other installations can also be useful in middleware and listeners. This is similar to how we don't just discard the I'm trying to find a way to eliminate this waste, while keeping it easy to implement a simplistic I think the difference is that I've proposed something like an overload for the Can we get the best of both? What if in JS and Python, we did the same |
The reference implementation of installation management in the Node SDK does not support multiple installations with incoming webhooks yet. My recommendation is to have historical data for all the installations and to provide a way to access them as necessary. See also: #1272 (comment) |
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. |
Description
Currently the
Installation
object contains a singleincomingWebhook
property, as an object with several properties. That works when an OAuth flow completes and the installation needs to be stored since a single installation can generate at most one Incoming Webhook. However, when another installation in the same workspace or organization occurs, it will create a new Incoming Webhook. This might also be fine if you're happy with theInstallationStore
storing a new record for this installation, even though most of the data in it is duplicative. However when fetching that installation, theInstallationStore
returns a singleInstallation
object, which can only contain one Incoming Webhook. That means one of the two Incoming Webhooks is not reachable.One possible solution is to update the interface for
Installation
so that theincomingWebhook
property becomesincomingWebhooks
, which contains an array of the created webhooks instead of just one. However we'd have to figure out howInstallationStore
s are meant to merge the individual installations into one. This might require a redesign of that interface, and updated implementations.Another solution is to update the return value of
fetchInstallation()
to be an array ofInstallation
objects. This would be simpler to implement, but would encourage storing duplicative data .There may be other good solutions available. Let's brainstorm and discuss.
Requirements (place an
x
in each of the[ ]
)The text was updated successfully, but these errors were encountered: