Atlassian,
We need to talk about Connect to Forge migration. This has become more urgent because of to the recent decisions regarding notifying customers of any use of Connect modules in Forge apps.
The thing is… in order to migrate our customer from Connect to Forge, we need to map the Forge installation to the previous Connect installation. As per recommendation by Atlassian, we used the Connect clientKey property as the unique identifier.
However, Forge does not provide us with that identifier upon installation. Forge does not have a migration lifecycle event. Forge does not care about Connect. It treats the migration as a fresh install.
We initially solved this using the connectModules lifecycle event in our manifest, as per Atlassian documentation, which allows us to capture the uninstall event which is triggered when a customer upgrades from Connect to Forge. However, adding this module to our manifest will trigger a “OH MY GOD, OH MY GOD, OH MY GOD, YOUR ENTIRE INSTANCE IS ABOUT TO BURST IN FLAMES” message to end-users.
So we went with the second option in the documentation, and instead called the API to get the connect key using the magic property.
The problem with that approach? That is documented here:
During app installation, the Atlassian account used by your app to authenticate with Atlassian APIs is granted various permissions and group memberships for the site it is being installed into. This process is eventually consistent, and the
installedevent may be sent before the app is granted the permissions needed to call certain APIs using.asApp(). For large sites, it may take a very long time (minutes) for your app user to be fully granted the requisite permissions.
We’re seeing situations in which the app does not yet have the required permissions to retrieve the clientKey from the API because the app is still being provisioned, even though the end-user can already interact with the app. So we can’t map the Forge installation with the Connect app, and as such cannot show them their data.
How does Atlassian want us to solve this?