Skip to content

Commit a889407

Browse files
committed
Use on_flush (not on_flushed) when calling restored callbacks
1 parent 3082912 commit a889407

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

shiny/bookmark/_bookmark.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,10 @@ async def invoke_on_restore_callbacks():
332332

333333
# Run the on_restored function after the flush cycle completes and
334334
# information is sent to the client.
335-
@session.on_flushed
335+
# Update: Using `on_flush` to have the callbacks populate the output message
336+
# queue going to the browser. If `on_flushed` is used, the messages stall
337+
# until the next `on_flushed` invocation.
338+
@session.on_flush
336339
async def invoke_on_restored_callbacks():
337340
print("Trying on restored")
338341
if self._on_restored_callbacks.count() == 0:

shiny/session/_session.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,6 @@ def verify_state(expected_state: ConnectionState) -> None:
665665
with session_context(self):
666666
self.app.server(self.input, self.output, self)
667667

668-
if self.bookmark.store != "disable":
669-
await reactive_flush() # TODO: Barret; Why isn't the reactive flush triggering itself?
670-
671668
elif message_obj["method"] == "update":
672669
verify_state(ConnectionState.Running)
673670

0 commit comments

Comments
 (0)