Unable to set different values for different environments in resource configuration

  • Goal: Have different X-API-Key headers for the production and staging environments for an OpenAPI resource.

  • Steps:

  1. Create a new OpenAPI resource
  2. Add values in the Headers
  3. Add a staging environment
  4. Add values in the Headers for the staging environment
  5. Save changes
  6. Observe that values in the Headers for the production environment now match values for the staging environment

I used to be able to have different Header values when switching between production and staging environments for the OpenAPI resource, now the value are overriding each other.

Over half of our apps now work only in one environment...

This is still happening - exact same issue as this person had some time ago Issue with Endpoint Change When Switching Environments in Retool

Reproduction steps still remain the same.

Still happening.

Environment variables also cannot be used, because the OpenAPI resource does not allow curly braces in the values for Headers!

I am also having this issue for x-api-key in my resources.

! was able to get around the issue using configuration variables. You can store different tokens for each environment there, and reference the configuration variable as the token value.

Thanks for reporting this!

@tomasvemola I was able to reproduce the bug you're showing in the screen recording, but the resource still works as expected in the app despite the incorrect resource set up (you can preview queries to see sanitized headers). Since I'm not seeing the issue persist in apps, I just wanted to double check that you are still seeing this issue persist within apps? Either way, definitely looks like a bug we should fix!

Yep this is happening to me too (just in case this wasn't more broadly known.)

Hi @Mentioum,

Thanks for chiming in. It's happening in apps and the resource configuration page?

Are you able to share screenshots?

Hi Tess,

I can confirm that the apps work correctly, even though the resource settings are not showing the correct values.

Although when using the OpenAPI resource, the headers do not seem to be sanitized (not when running, or previewing).

Staging headers

Production headers

In my resource settings, both environments are showing values for the production headers.

The issue isn't to do with the resulting activity from what I can see. I may be writing this in the wrong thread as this is happening for all REST API resources for me at the moment.

In the resource editing window (either via the query (in apps) or via the resources). There appears to be a rendering issue where fields are not updating correctly and/or are being replicated between environments.

I think screenshots will be more unhelpful as its hard to show... and i cant reproduce as its broken - I currently cant get the two environments to show different values for headers (even if I think they are saving correctly). I'm scared to check too much in case it breaks the resource.

Essentially editing the headers (and a few other things) in the production environment appears to edit them in the staging environment when switching between environments. The opposite is also true (staging -> production).

I appears that it 'SAVES' correctly so it works... but it shows the wrong thing in the UI consistently. I'm tentative about testing further.

1 Like

Yes, that's exactly what's happening on my side as well.

I actually did test it, and it seems exactly what you describe is happening.

1 Like

Thanks both! That's what I'm seeing too - it makes it super tricky to troubleshoot :disappointed:

@tomasvemola That looks correct for the headers by the way. We only sanitize certain headers, such as 'Authorization'

I'll follow up when I hear back from our engineering team

1 Like