From 0f1904404cc1d3af26f2e7c5bc499930f72f78c0 Mon Sep 17 00:00:00 2001 From: Benedikt Bartscher Date: Mon, 28 Oct 2024 22:40:26 +0100 Subject: [PATCH] showcase potential bug for #4248 --- reflex/app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index 5923e3389..cd0fe1993 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -69,7 +69,7 @@ from reflex.components.core.client_side_routing import ( ) from reflex.components.core.upload import Upload, get_upload_dir from reflex.components.radix import themes -from reflex.config import environment, get_config +from reflex.config import environment, get_config, interpret_boolean_env from reflex.event import Event, EventHandler, EventSpec, window_alert from reflex.model import Model, get_db_status from reflex.page import ( @@ -505,7 +505,10 @@ class App(MiddlewareMixin, LifespanMixin, Base): # Check if the route given is valid verify_route_validity(route) - if route in self.unevaluated_pages and os.getenv(constants.RELOAD_CONFIG): + if route in self.unevaluated_pages and interpret_boolean_env( + os.getenv(constants.RELOAD_CONFIG), + field_name="RELOAD_CONFIG", + ): # when the app is reloaded(typically for app harness tests), we should maintain # the latest render function of a route.This applies typically to decorated pages # since they are only added when app._compile is called.