reflex/tests
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
..
compiler pass lang and custom_attrs from app to html root (#2697) 2024-03-03 13:51:20 -08:00
components [REF-2265] ComponentState: scaffold for copying State per Component instance (#2923) 2024-03-29 09:22:25 -07:00
middleware [REF-201] Separate on_load handler from initial hydration (#1847) 2023-11-30 12:21:15 -08:00
states RED-1052/rx.State as Base State (#2146) 2023-11-29 09:43:33 -08:00
utils [REF-2141] Custom component command improvements (#2807) 2024-03-07 20:42:22 -08:00
__init__.py RED-1052/rx.State as Base State (#2146) 2023-11-29 09:43:33 -08:00
conftest.py [REF-201] Separate on_load handler from initial hydration (#1847) 2023-11-30 12:21:15 -08:00
test_app.py [REF-2127] Loosen requirements (#2796) 2024-03-29 09:26:53 -07:00
test_base.py Rename pynecone to reflex (#1236) 2023-06-25 16:56:55 -07:00
test_config.py Added Environmental variable REFLEX_DIR (#2457) 2024-01-30 18:18:29 -08:00
test_db_config.py Rename pynecone to reflex (#1236) 2023-06-25 16:56:55 -07:00
test_event.py RED-1052/rx.State as Base State (#2146) 2023-11-29 09:43:33 -08:00
test_model.py supply default for sqlmodel PK for both DB and python to work (#1788) 2023-09-08 14:51:57 -07:00
test_prerequisites.py Skip frontend packages install if previously done (#2400) 2024-01-16 17:52:28 -08:00
test_route.py Allow underscores in routes (#1713) 2023-09-08 12:18:33 -07:00
test_state_tree.py [REF-1988] API to Get instance of Arbitrary State class (#2678) 2024-02-27 13:02:08 -08:00
test_state.py [REF-2219] Avoid refetching states that are already cached (#2953) 2024-03-29 09:42:25 -07:00
test_style.py Handle component namespaces in global styles (#2630) 2024-02-15 16:03:10 -08:00
test_telemetry.py telemetry refactor + unit tests (#2786) 2024-03-13 12:38:54 -07:00
test_testing.py Avoid passing props to lists and list items (#2326) 2023-12-21 15:58:45 -08:00
test_var.py Initial values for computed vars (#2670) 2024-02-24 13:45:07 -08:00