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!

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