reflex/tests/integration
Masen Furer 39cdce6960
[HOS-333] Send a "reload" message to the frontend after state expiry (#4442)
* Unit test updates

* test_client_storage: simulate backend state expiry

* [HOS-333] Send a "reload" message to the frontend after state expiry

1. a state instance expires on the backing store
2. frontend attempts to process an event against the expired token and gets a
   fresh instance of the state without router_data set
3. backend sends a "reload" message on the websocket containing the event and
   immediately stops processing
4. in response to the "reload" message, frontend sends
   [hydrate, update client storage, on_load, <previous_event>]

This allows the frontend and backend to re-syncronize on the state of the app
before continuing to process regular events.

If the event in (2) is a special hydrate event, then it is processed normally
by the middleware and the "reload" logic is skipped since this indicates an
initial load or a browser refresh.

* unit tests working with redis
2024-11-28 13:56:41 +01:00
..
init-test reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
shared reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
tests_playwright improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
__init__.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
conftest.py More env var cleanup (#4248) 2024-11-05 12:25:13 -08:00
test_background_task.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_call_script.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_client_storage.py [HOS-333] Send a "reload" message to the frontend after state expiry (#4442) 2024-11-28 13:56:41 +01:00
test_component_state.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_computed_vars.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_connection_banner.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_deploy_url.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_dynamic_components.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_dynamic_routes.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_event_actions.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_event_chain.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_exception_handlers.py test_exception_handlers: add test case that triggers ErrorBoundary (#4327) 2024-11-07 16:01:37 -08:00
test_form_submit.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_input.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_large_state.py stop ignoring some lint rules (#4311) 2024-11-06 13:32:31 -08:00
test_lifespan.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_login_flow.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_media.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_navigation.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_server_side_event.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_shared_state.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_state_inheritance.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_tailwind.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_upload.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
test_urls.py use pathlib as much as possible (#3967) 2024-10-03 17:50:39 +02:00
test_var_operations.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
utils.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00