The problem
Our app stops working for organizations that upgrade to Enterprise Grid.
The cause
This happens when an organization installs an app before they have an enterprise plan (where InstallationQuery.enterprise doesn't exist), and then upgrade to an enterprise plan (where InstallationQuery.enterprise does exist).
In that scenario, a previously stored installation wouldn't have the enterpriseId field, but new requests (events, actions etc.) will have the enterprise object on the InstallationQuery, so fetchInstallation won't find it.
The solution(?)
I think it would make sense to only use enterpriseId when isEnterpriseInstall is false, but I don't know all the considerations intimately like @seratch does. For Mongoose, where the queries are made against a single string field (__appOrgWorkspace__, see here:
|
where[this.searchColumnNameForApp] = `${this.clientId}:${query.enterpriseId}:${teamId}`; |
) this will probably require a DB migration to work properly for existing installations (or more complex code to query by regex and filter in JS or something similar).
For us, we have previously ported one of the packages here so we can just make a change in our codebase, but we wanted to be good Samaritans and report this, and also get feedback.
The problem
Our app stops working for organizations that upgrade to Enterprise Grid.
The cause
This happens when an organization installs an app before they have an enterprise plan (where
InstallationQuery.enterprisedoesn't exist), and then upgrade to an enterprise plan (whereInstallationQuery.enterprisedoes exist).In that scenario, a previously stored installation wouldn't have the
enterpriseIdfield, but new requests (events, actions etc.) will have theenterpriseobject on theInstallationQuery, sofetchInstallationwon't find it.The solution(?)
I think it would make sense to only use
enterpriseIdwhenisEnterpriseInstallisfalse, but I don't know all the considerations intimately like @seratch does. For Mongoose, where the queries are made against a single string field (__appOrgWorkspace__, see here:slack-bolt-extensions/packages/bolt-mongoose/src/MongooseInstallationStore.ts
Line 217 in ef15b44
For us, we have previously ported one of the packages here so we can just make a change in our codebase, but we wanted to be good Samaritans and report this, and also get feedback.