rstudio / shiny

Easy interactive web applications with R
http://shiny.rstudio.com
Other
5.3k stars 1.87k forks source link

Updating reactive value on a timer results on JS error #4046

Closed cpsievert closed 1 month ago

cpsievert commented 1 month ago

Introduced by #4039. This app now produces a JS error: Shiny server has sent a progress message for number, but the output is in an unexpected state of: idle.

Seems it's expected that a progress message can be sent to move output status from Idle to Invalidated (i.e., skip the value stage)

library(shiny)

devmode()

ui <- fluidPage(uiOutput("number"))

server <- function(input, output, session) {
    output$number <- renderUI({ val() })
    val <- reactiveVal(0)
    observe({
        invalidateLater(3000)
        val(runif(1))
    })
}

shinyApp(ui, server)