New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query String Parameters not updated after rerun #5511
Comments
Doing it like this works for me: st.experimental_set_query_params(**query_params)
time.sleep(0.1)
st.experimental_rerun() |
@blipk Thank you, for your answer, it actually solves the problem somewhat, but it seems quite hacky :P Nevertheless, it directed me to the trail of race condition in the handling of reruns. @LukasMasuch It iterate over all connected sessions ( streamlit/lib/streamlit/runtime/runtime.py Line 579 in 909d9b8
On the other hand, In the code of
So there is some race condition between sending messages to client, and clearing queue for new script run, which, in the case of a more heavily loaded server, can cause the unforeseen loss of many queue messages. We should probably somehow wait until all the messages have been sent, instead of clearing the message queue. |
I am also deeply annoyed by this issue. |
Hi @pkubiak , I just checked this with this app: |
Summary
When
st.experimental_set_query_params
call is followed byst.experimental_rerun
, updated query params are visible to streamlit (viast.experimental_get_query_params
) but browser address bar is not updated.Use case: Use query params to store dashboard parameters and change them with button click (rerun is required to update dashboard).
Steps to reproduce
Code snippet:
Expected behavior:
Query String parameters are updated after executing
st.experimental_set_query_params
even whenst.experimental_rerun
is used.Actual behavior:
Query String is updated somewhere internally (it is visible to streamlit), but the change is not reflected in the browser (in address bar).
Is this a regression?
Probably not
Debug info
1.13.0
3.10.0
Windows 10; Build 19044.1889
Chrome 106.0.5249.91
Potential workaround
Reset query params on each requests:
The text was updated successfully, but these errors were encountered: