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!