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

Shiny Server Pro: updateQueryString() serious bug, URL path gets modified instead of only query string #437

Open
daattali opened this issue Mar 29, 2020 · 3 comments

Comments

@daattali
Copy link
Contributor

The following sample code works fine when run locally or in a Shiny Server open source. It simply modifies the query string by adding ?foo=bar to the URL:

library(shiny)

ui <- fluidPage(
  actionButton("go", "go")
)

server <- function(input, output, session) {
  observeEvent(input$go, {
    updateQueryString("?foo=bar")
  })
}

shinyApp(ui, server)

The resulting URL is something like http://161.35.12.208:3838/?foo=bar

When this is hosted in a Server Pro (originally noticed in an old version, but verified with version 1.5.13.1042), the path is modified by adding what I think is the websocket ID or something of the sort. The URL looks like http://161.35.12.208:3838/_w_f4c3815de52bf40b929533b353fa29d241364cfe8082544a/?foo=bar

@jcheng5
Copy link
Member

jcheng5 commented Apr 27, 2020

@wch I hate to say it but this might need to be worked around in Shiny. Or at least Shiny would need to put in some kind of hook to let SSP rewrite the URL before it's stuck in the URL bar. Or maybe we need to give up on the idea of base href, it's so painful.

@daattali
Copy link
Contributor Author

daattali commented Apr 27, 2020

I know this is understood by you at this point, but for completeness I'll add that the issue arises when just doing a plain javascript update (like what shiny is doing)

window.history.replaceState(null, null, "?foo=bar")

I didn't realize this at the time, now I see why this is an ugly bug

@llrs
Copy link

llrs commented Aug 23, 2022

I am not completely sure but I think this happens too in some cases with the values field. I posted a question in the Rstudio community a while ago, describing something similar described here: the _values_ becomes _values_= when connection is made with shiny-server. This is with Shiny Server open source.

Was this ever fixed or a workaround proposed with shiny?

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

3 participants