reflex/tests
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
..
integration [HOS-333] Send a "reload" message to the frontend after state expiry (#4442) 2024-11-28 13:56:41 +01:00
units [HOS-333] Send a "reload" message to the frontend after state expiry (#4442) 2024-11-28 13:56:41 +01:00
__init__.py upgrade to latest ruff (#3497) 2024-06-19 12:32:13 +02:00
test_node_version.py improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00