Skip to content

Commit

Permalink
Handle trigger resets for interrupted scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
AnOctopus committed Sep 8, 2023
1 parent 44f419c commit 1081c13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/streamlit/runtime/scriptrunner/script_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ def request_stop(self) -> None:
"""
self._requests.request_stop()

self._session_state._state._reset_triggers()
# "Disconnect" our SafeSessionState wrapper from its underlying
# SessionState instance. This will cause all further session_state
# operations in this ScriptRunner to no-op.
Expand Down
4 changes: 2 additions & 2 deletions lib/streamlit/runtime/state/session_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ def on_script_will_rerun(self, latest_widget_states: WidgetStatesProto) -> None:
Update widget data and call callbacks on widgets whose value changed
between the previous and current script runs.
"""
# Update ourselves with the new widget_states. The old widget states,
# used to skip callbacks if values haven't changed, are also preserved.
# Clear any triggers that weren't reset because the script was disconnected
self._reset_triggers()
self._compact_state()
self.set_widgets_from_proto(latest_widget_states)
self._call_callbacks()
Expand Down

0 comments on commit 1081c13

Please sign in to comment.