reflex/reflex
Masen Furer 55b0fb36e8
[REF-2219] Avoid refetching states that are already cached (#2953)
* Add test_get_state_from_sibling_not_cached

A better unit test to catch issues with refetching parent states
and calculating the wrong parent state names to fetch.

* _determine_missing_parent_states: correctly generate state names

Prepend only the previous state name to the current relative_parent_state_name
instead of joining all of the previous state names together.

* [REF-2219] Avoid refetching states that are already cached

The already cached states may have unsaved changes which can be wiped out if
they are refetched from redis in the middle of handling an event.

If the root state already knows about one of the potentially missing states,
then use the instance that is already cached.

Fix #2851
2024-03-29 09:42:25 -07:00
..
.templates Set is_hydrated=False at route onChangeStart (#2949) 2024-03-29 09:41:18 -07:00
compiler [REF-2127] Loosen requirements (#2796) 2024-03-29 09:26:53 -07:00
components Set is_hydrated=False at route onChangeStart (#2949) 2024-03-29 09:41:18 -07:00
constants [REF-2086] Avoid "Warning: The path to the Node binary could not be found. (#2803) 2024-03-13 12:35:43 -07:00
custom_components [REF-2168] Add share options to custom component commands (#2883) 2024-03-28 15:13:37 -07:00
middleware feat: Synchronizing localStorage between tabs using browser events (#2533) 2024-02-20 15:14:55 -08:00
utils [REF-2127] Loosen requirements (#2796) 2024-03-29 09:26:53 -07:00
__init__.py [REF-2127] Loosen requirements (#2796) 2024-03-29 09:26:53 -07:00
__init__.pyi [REF-2265] ComponentState: scaffold for copying State per Component instance (#2923) 2024-03-29 09:22:25 -07:00
__main__.py add __main__ entry point to allow python -m reflex (#1516) 2023-08-03 14:26:50 -07:00
admin.py Allow view overrides for registering models with admin (#1249) 2023-06-27 14:08:09 -07:00
app_module_for_backend.py [REF-2172] Add DECORATED_PAGES before compiling in thread (#2841) 2024-03-12 10:28:37 -07:00
app.py [REF-2127] Loosen requirements (#2796) 2024-03-29 09:26:53 -07:00
app.pyi Track state usage (#2441) 2024-03-07 14:25:55 -08:00
base.py [REF-2127] Loosen requirements (#2796) 2024-03-29 09:26:53 -07:00
config.py [REF-2127] Loosen requirements (#2796) 2024-03-29 09:26:53 -07:00
config.pyi Track state usage (#2441) 2024-03-07 14:25:55 -08:00
event.py [REF-2272] Support declaring EventHandlers directly in component (#2952) 2024-03-29 06:26:07 -07:00
model.py Bare sqlalchemy metadata (#2355) 2024-03-13 15:32:35 -07:00
page.py Update meta parameter to accept a list of any type (#2477) 2024-01-29 16:52:28 -08:00
reflex.py [REF-2168] Add share options to custom component commands (#2883) 2024-03-28 15:13:37 -07:00
route.py [REF-1741] Disallow routes with /api prefix (#2711) 2024-02-26 19:34:51 -08:00
state.py [REF-2219] Avoid refetching states that are already cached (#2953) 2024-03-29 09:42:25 -07:00
style.py [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
testing.py [REF-2416] Pass shell=True when starting AppHarness on Windows (#2944) 2024-03-27 16:22:58 -07:00
vars.py [REF-2302] When a Var points to a model, prefer access to model fields. (#2893) 2024-03-27 16:22:46 -07:00
vars.pyi Initial values for computed vars (#2670) 2024-02-24 13:45:07 -08:00