Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RobustSockJS collision repro #500

Open
jcheng5 opened this issue Sep 22, 2021 · 0 comments
Open

RobustSockJS collision repro #500

jcheng5 opened this issue Sep 22, 2021 · 0 comments

Comments

@jcheng5
Copy link
Member

jcheng5 commented Sep 22, 2021

Running this app with DevTools showing, click the button within a few seconds of startup, and wait in the debugger for a few seconds. When you press Continue, you get the RobustSockJS collision error message.

When reproducing this, I had jsonp-polling as the only protocol enabled, not sure if that is relevant or not.

library(shiny)

ui <- fluidPage(
  tags$p(
    tags$strong("Instructions: "),
    "Press \"Cause error\". The correct behavior is for the counter to keep counting; the buggy behavior is for the counter to stop."
  ),
  textOutput("counter"),
  actionButton("go", "Cause error"),
  tags$script(HTML(r"{
    Shiny.addCustomMessageHandler('errorme', function(msg) {
      throw new Error('boom');
    });
  }"))
)

server <- function(input, output, session) {
  i <- 0
  output$counter <- renderText({
    invalidateLater(1000)
    i <<- i + 1
    i
  })

  observeEvent(input$go, {
    session$sendCustomMessage("errorme", list())
  })
}

shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant