Upgrading runtime to nodejs breaks external auth until the app is disconnected

We’ve been running on the sandbox runtime since the start. At one point, when the nodejs runtime was announced, we tried it in development and found that external auth calls occasionally failed with a “not supported” error. Because of this, we decided to keep the sandbox runtime and wait.

With the deprecation of sandbox announced, we are giving nodejs another try.

After changing the runtime in the manifest to either nodejs18.x or nodejs20.x and deploying the app on our dev instances, we noticed these errors popping up in the log (and the app would obviously not work):

We found nothing in the documentation or in Forge posts in regards to this error.
The only solution we found was to open the user’s “Connected apps” page and “disconnect” our app. From there, we could go through the approval process in our dev instance and external auth started working again.

Has anybody faced this issue? My biggest concern is I do not want our customers to have to “disconnect” our app, just to then go through the approval process again as soon as we publish our next version.

3 Likes

Thanks for raising @PascalPerreault. This isn’t something we were aware of but we’ll investigate.

Upgrading your runtime certainly shouldn’t break external auth.

Hi @PascalPerreault, going between the sandbox runtime and the nodejs runtimes should not cause the connections to external providers to disconnect. I have tested a couple of scenarios to confirm this and wasn’t able to reproduce this error. Are you able to provide the version of @forge/api which you are using and your appId so that I can take a closer look?

1 Like

Thanks @AdamMoore.

Would you mind sharing a link to the investigation task, if you have one, so I can follow it?

Kind regards,

Hi @BoZhang ,

Thank you for the confirmation.

My @forge/api version is 3.6.0 and the appId is 247aec13-ea82-445b-8dd5-59cb2bbb1c88.

I cannot replicate the issue with my user since I’ve already removed the connection but I will ask my colleagues in case they still have theirs from my test instance, if it can help you.

Please let me know if there is anything else I can provide to help.

Kind regards,

Thanks @PascalPerreault, I have taken a look at our logs and implementation and cannot see how this particular edge condition was reached with that version of the @forge/api. Perhaps there is some edge case that I couldn’t think of so If any of your colleagues are able to reproduce the error, that would be great. In the meantime, I will keep an eye out for any more instance of the error code that you’ve mentioned.

2 Likes

Hi @BoZhang ,

My colleagues did not have the same issue on my dev instance. They didn’t already have the app connected so they simply went through the approval process and the change was transparent to them.

I tried rolling back to sandbox, disconnecting my app, approving the app, and re-upgrade. Sadly, the problem could not be replicated.

When I downgraded to sandbox, another error occurred, but alas I didn’t take a screen capture of it (I should have, but I don’t think this would be a problem). Playing around upgrading/downgrading, I cannot replicate this error either.

I double-checked with a different dev instance (which never had the nodejs20.x runtime published yet) and couldn’t replicate the issue either.

I do not know if it can help you, but the issue I had was with a Slack external auth which requires the scopes to be provided as additional query parameters in the manifest.

I will keep looking and let you know if I find anything else. It worries me that the issue cannot be replicated since I was completely stuck when it occurred.

Please let me know if I can provide any more information or help.

Kind regards,