diff options
| author | Tyler <tyler@tylerhoang.xyz> | 2026-05-17 00:58:25 -0700 |
|---|---|---|
| committer | Tyler <tyler@tylerhoang.xyz> | 2026-05-17 00:58:25 -0700 |
| commit | 48f3bc1960d71785aad44292205845612a4f1cb8 (patch) | |
| tree | 10e2d10ded75523b7e3de3c4ac925ff0e2979b62 /utils/security.py | |
| parent | e885be599095037f93209d42ba55c77c2fb6b6ee (diff) | |
Fix persistence write-before-read and click swallow bugs
Two root causes:
1. The JS wrote empty session defaults to localStorage before reading
stored values back, destroying saved data on every fresh page load.
Fixed by gating on data-loaded: JS reads+restores only when loaded=0,
writes+saves only when loaded=1.
2. st.rerun() inside render_persistence_bridge() aborted the render
before qt_click_receiver/wl_click_receiver were registered. Streamlit
clears unrendered widget state, so pending click values (_qt_click,
_wl_click) were wiped before quotetable/watchlist could process them.
Fixed by removing st.rerun() — the bridge runs at the top of the
render cycle so restored session state propagates to components below
in the same pass; no extra rerun needed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'utils/security.py')
0 files changed, 0 insertions, 0 deletions
