Switching between environments is buggy

Continuing the discussion from Switching between environments:

I can't identify a set of steps to reproduce, but this issue is still happening and it's extremely annoying.

Hi @Michael_Stone,

Apologies for this issue. Can you share a screen recording of this behavior?

The environment should not be switching back in the app editor after you change it :thinking:

hey Jack, yes I can, what's the best way of doing that?

1 Like

@Michael_Stone I use Loom which is a free video recording software.

Some other types of video formatting do not work with the community forum but Looms work for both posting in threads as well as private DM messages when users have more sensitive data as well!

Hey Jack, this issue is really hard to reproduce. When it happened last time i took a vid in .mp4. Is there any way to send that to you?

Ahh ok totally understand, those hard to reproduce bugs are the trickiest.

I think you can DM a mp4 to me if you click on my account and then "Message", and if that doesn't work, I know that users in the past can add an mp4 to a google drive and then share the link to that via DM as well.

It seems that this issue is caused my a URL param set to specify the environment, it doesn't let you switch environments :sweat_smile:

As the browser will try to direct the app back to the environment that matches whichever the URL params specify. Removing the param should allow for smooth toggling between environments!

Hey Jack, I've tried removing the url param and that doesn't work either. It still switches back to staging

Thank you for letting me know, that is very odd @Michael_Stone.

Can you share a recording of the URL when you try to change environments, I am curious to see if the it changes in the same way that the env display changes really quickly then flashes back.

Are all of your resources set up for both environments? Can you share a screenshot of the environments from the Settings page?

I haven't been able to reproduce this, going to investigate further to see if anyone has encountered this.

Does it occur if you make a new app, add in one resource that is set up for staging and prod in its resource configuration and then toggle between the two?

Hi @Michael_Stone,

Are you still experiencing this issue? Do you have any resources that are not enabled for both environments?

Let me know if you are able to answer any other the questions I asked above to help me better understand the context of your setup!

Hi Jack, I think I've finally found why this was happening and it was completely our fault! There was a custom JS script which was setting the _environment query param based on the user isProductionAccessAllowed that I think defaults to 'No', so we hadn't set it for anyone. Thanks for your help, and apologies for the noise!