posit-dev / posit-dev/py-shiny

[Bug]: session.on_flushed callbacks do not trigger messages being sent to client

Open
#1,889 0 comments 0 reactions 1 assignee View on GitHub

@schloerke is already working on this.

Since Mar 5, 2025.

bug
Dominant language
Python
Stars
1.8k
Forks
135
Avg merge
2d 18h
Merged PRs (30d)
21

Description

Component

Reactive Programming

Severity

P2 - Medium (workaround exists)

Shiny Version

1.3.0

Python Version

Any (including pyodide)

Minimal Reproducible Example

shinylive

from shiny.express import input, render, ui, session

ui.input_text("foo", "Foo")

@session.on_flushed
def _():
    ui.update_text("foo", value = "Flushed")
Behavior

In the example above, ui.update_text() is called, but because it's part of an on_flushed, it doesn't actually get sent to the client. (If the app had some other outputs/effects, then the next time a flush naturally occurred, then the update_text would take effect.)

Here's the same example in R, which doesn't exhibit the problem.

Error Messages (if any)

Environment
shinylive.io

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.