Skip to content
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

1.24 causes full app rerenders on small changes #6920

Closed
3 tasks done
RmStorm opened this issue Jun 29, 2023 · 4 comments · Fixed by #6923
Closed
3 tasks done

1.24 causes full app rerenders on small changes #6920

RmStorm opened this issue Jun 29, 2023 · 4 comments · Fixed by #6923
Labels
feature:st.spinner status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working

Comments

@RmStorm
Copy link

RmStorm commented Jun 29, 2023

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

I updated to Streamlit 1.24.0 and now my app is completely rerendering on every change. Something is just completely nuking the react elements and causing them to rerender from scratch. I have created two gifs to show you exactly what I mean. This is clearly not desired behavior I think..

I don't have time to make a reproducible example for you but I think the gifs make it pretty clear what's happening. I will just stick to 1.23.1 for now. It's particularly bad for the map element since it's zoom, center and it's loaded tiles get reset.

Good in 1.23.1 Bad in 1.24
good1 23 1 bad1 24 0

Expected Behavior

Don't re-render everything from scratch

Current Behavior

It re-renders from scratch

Debug info

  • Streamlit version: 1.24.0
  • Python version: 3.9.10
  • Operating System: Linux Mint 21.1
  • Browser: Mozilla Firefox 114.0.2
  • Virtual environment: see dependency list ⬇️

grpcio-tools==1.54.2
polars==0.18.3
typer==0.9.0
shapely==2.0.1
geopandas==0.13.2
geopolars==0.1.0a4
streamlit==1.24.0
@RmStorm RmStorm added status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working labels Jun 29, 2023
@LukasMasuch LukasMasuch added status:confirmed Bug has been confirmed by the Streamlit team and removed status:needs-triage Has not been triaged by the Streamlit team labels Jun 29, 2023
@LukasMasuch
Copy link
Collaborator

@RmStorm Thanks for reporting this issue. I suspect that this is caused by a change we did for st.spinner. Is your code using st.spinner or cached functions?

@RmStorm
Copy link
Author

RmStorm commented Jun 29, 2023

Hey @LukasMasuch I'm not using the spinner directly but I am using both the cache_data and cache_resource decorators. Pretty sure that those invoke spinner since I've seen the spinner once or twice 😅

@LukasMasuch
Copy link
Collaborator

LukasMasuch commented Jun 29, 2023

Ok, thanks for the info. I would assume that setting show_spinner=False for all cache_data and cache_resource uses in your app would fix this with Streamlit 1.24 (if you still have it running, it would be awesome if you could test this). For a proper solution, we might roll out a patch soon.

@RmStorm
Copy link
Author

RmStorm commented Jun 29, 2023

Thank you! That indeed bypasses the issue so your suspicion is probably spot on. 😄 When I disable the spinner I get the same good behaviour on 1.24 that I had on 1.23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.spinner status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants