Repository navigation
Conversation
The docstring said Shiny serializes effects behind a process-wide reactive.lock(). Shiny no longer takes that lock (posit-dev/py-shiny#2508) and is deprecating it (posit-dev/py-shiny#2520). State the guarantees that keep this method safe in both the current and the upcoming Shiny.
13 of 16 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a docstring in the conversation history code. It said
on_response()is safe because of a lock that py-shiny no longer takes.Summary
The
HistoryController.on_response()docstring said thaton_response()is safe without a lock because "Shiny serializes reactive flushes behind a single process-widereactive.lock()". posit-dev/py-shiny#2508 removes Shiny's use of that lock, and posit-dev/py-shiny#2520 deprecates it. The new docstring states the two guarantees that keep the method safe:_save_on_responsecannot overlap.self.record. Shiny holds input changes until all effects of the session are finished, so those effects cannot run whileon_response()is paused at anawait.Review Notes
Testing
ruff checkpasses.ruff format --checkreports a difference on one line that this PR does not change. The same difference is onmain.Refs posit-dev/py-shiny#2508, posit-dev/py-shiny#2520