STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_session_epoch Namespace Reference

Functions

 test_every_session_has_its_own_epoch ()
 test_the_config_routes_report_the_epoch ()
 test_a_wholesale_load_is_stamped_so_another_tab_can_tell_it_is_not_its_own ()

Detailed Description

A recreated backend session is recognisable, so the design bar never autosaves its default.

2026-10-01: a backend restart left the session holding configs/default.yaml (methalox); the design
bar's autosave read it as an edit and saved it over an ethalox design. The bar now compares the
session epoch it loaded the design into with the one the backend reports, and restores the design
when they differ. This guards the backend half: every session object has its own epoch, and the
config routes the bar reads report it.

Function Documentation

◆ test_a_wholesale_load_is_stamped_so_another_tab_can_tell_it_is_not_its_own()

test_session_epoch.test_a_wholesale_load_is_stamped_so_another_tab_can_tell_it_is_not_its_own ( )
The session is one per user and every tab shares it. Tab B opening design X POSTs X over
the design Y tab A holds; A's autosave then read X as an edit and saved it into Y. Every
wholesale load now gets a fresh token, and a fresh session has none (only the default is in
it), so A can refuse to autosave a config it did not load, and a read-only tab can tell a
default it may replace from another tab's design it must not.

Definition at line 39 of file test_session_epoch.py.

◆ test_every_session_has_its_own_epoch()

test_session_epoch.test_every_session_has_its_own_epoch ( )

Definition at line 20 of file test_session_epoch.py.

◆ test_the_config_routes_report_the_epoch()

test_session_epoch.test_the_config_routes_report_the_epoch ( )

Definition at line 25 of file test_session_epoch.py.