App Bridge - possible bug or outdated docs

Hello, I’ve just upgraded an app from AppBridge v1.6.1 to v1.6.7 and noticed an issue:

Expected behaviour: Open the app’s URL outside an iFrame. AppBridge redirects, loading the app inside iFrame.

Actual behaviour: AppBridge does not redirect to iFrame.

I’ve found that explicitly passing forceRedirect: true to createApp() fixes the issue, but the docs make it seem like it’s the default. It looks like this change was introduced in v1.6.5

Is this a bug, or are the docs out of date? Please advise.

Flávio

Hey @Anonymous .

The default value for forceRedirect in development mode is false. In production mode it’s true. Essentially if NODE_ENV !== 'development' then the forceRedirect value will be false (assuming you’re using a Node stack). If you’re using the CDN import, then we assume you’re running in production. If that’s the case for you, let me know, as that would probably be unintended.

The documentation can be improved in conveying this, in fact it doesn’t look like it does at all. I’ll work on getting that updated for future visitors.

Cheers.

Thanks, Alex.

I appreciate you looking into this. I would suggest to default forceRedirect to true, both in development and production, which I believe was used until v1.6.4. This makes is more seamless to work with embedded apps, and might prevent some issues for people who are migrating from older versions, like I just did.

I’m developing a Rails app, and loading AppBridge via webpacker.

Cheers,

Flávio

2 Likes