retoolContext.environment – but for the new builder

Since converting our massive* classic app, we want to make absolutely sure we do all our testing and QA in our staging DB.

Recalling how easy it was in classic environment to use retoolContext.environment, I asked the builder to show a big red-alert modal any time the environment is set to production, and not close it until the environment is set to staging.

Long story short, after trying several things, it concluded / confessed that no, it has no ability to detect which environment is active, and suggested that I let you know that β€œR2 apps need a first-class environment primitive” to accomplish this. Ok, here I am!

Relatedly, I also noticed that when I do change the environment, it does not automatically refresh the way classic would. You’re still looking at data from the previous environment until manually refreshing the app preview. This gets weird, because if I continue to interact with the data in the app (after changing the environment but not refreshing), the data is still from the previous environment.

*the builder chat actually described our app with this word when we initiated conversion, ha!

2 Likes

Thanks for reaching out, @Schteevynn! You make a good point - exposing org context to the agent is definitely something that we're thinking about. I'll add your comments to the internal tracking ticket and give you an update as soon as I can!

The other issue that you're describing is definitely familiar. We're working on a few different changes/fixes that should hopefully make this more reliable. :+1:

1 Like

hey :slight_smile: i want to hook into this conversation because switching the environments (retoolContext.environment) is an essential feature of V1 (the legacy app builder).
without this feature it is almost not possible to migrate our apps to the new app-builder.

thanks in advance and happy building!

+1 for this. I have just done the initial migration from a very large multipage classic app to the new app and very confused that all of my retoolContext.configVars are no longer usable - the regression of the core context makes a multi-space and multi-region deployment a nightmare to manage and impossible to continue without a huge amount of work :worried: