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

shinyTree with "&" in list names disconnects on shinyapps.io #100

Open
psimm opened this issue Sep 17, 2020 · 6 comments
Open

shinyTree with "&" in list names disconnects on shinyapps.io #100

psimm opened this issue Sep 17, 2020 · 6 comments

Comments

@psimm
Copy link

psimm commented Sep 17, 2020

When a list passed to renderTree contains multiple & symbols, and the app is hosted on shinyapps.io, the server disconnects and a notification saying: "attempting to reconnect" keeps flashing. I passed this to the RStudio support and they reproduced the problem and recommended I file an issue here.

I can't reproduce the issue locally on macOS 10.15.6 or on Ubuntu 18.04 LTS running R 3.6.3 with shiny 1.5.0 and shinyTree 0.2.7 from CRAN. So it could be related to the Linux or Shiny server environment.

Here is a sample app:

library(shiny)
library(shinyTree)

tree <- list(
   A = structure(list(
     `Gifts & Sets` = structure(0, stselected = TRUE),
     Jewellery = structure(0, stselected = TRUE),
     `Socks & Tights` = structure(0, stselected = TRUE),
     Tweezers = structure(0, stselected = TRUE)
  ), stselected = TRUE),
  B = structure(list(
     `Gifts & Sets` = structure(0, stselected = TRUE),
     `Hand & Feet` = structure(list(
        Treatments = structure(0, stselected = TRUE)
     ), stselected = TRUE)
   ), stselected = TRUE)
)

shinyApp(
   ui = fluidPage(shinyTree("tree")),
   server = function(input, output) {
      output$tree <- renderTree(tree)
   }
)

And here is the app on shinyapps.io: https://psim.shinyapps.io/shiny_tree_test/

Removing any single line, even the Jewellery item for example, caused the issue to disappear on shinyapps.io.

I understand that this is a rare niche use case and debugging it may not be worth the time. For practical use the issue is fixed by removing the & from the list names.

@trafficonese
Copy link
Contributor

Did you check the shinyapps.io Logs? Maybe there is some useful information.

And btw. the link you provided works for me.

@psimm
Copy link
Author

psimm commented Sep 29, 2020

Hi @trafficonese thanks for the reply.

Yes I checked the logs and the RStudio support team checked them too. Nothing about the connection problem, unfortunately. Here they are:

2020-09-29T09:45:46.358636+00:00 shinyapps[2781829]: Starting R with process ID: '24'
2020-09-29T09:52:53.507691+00:00 shinyapps[2781829]: Running on host: feea4c37cf1c
2020-09-29T09:52:53.512858+00:00 shinyapps[2781829]: Server version: 1.8.4.1-20
2020-09-29T09:52:53.512871+00:00 shinyapps[2781829]: R version: 3.6.3
2020-09-29T09:52:53.512903+00:00 shinyapps[2781829]: knitr version: (none)
2020-09-29T09:52:53.512871+00:00 shinyapps[2781829]: LANG: en_US.UTF-8
2020-09-29T09:52:53.512877+00:00 shinyapps[2781829]: shiny version: 1.5.0
2020-09-29T09:52:53.512886+00:00 shinyapps[2781829]: httpuv version: 1.5.2
2020-09-29T09:52:53.512895+00:00 shinyapps[2781829]: rmarkdown version: (none)
2020-09-29T09:52:53.512911+00:00 shinyapps[2781829]: jsonlite version: 1.6.1
2020-09-29T09:52:53.681610+00:00 shinyapps[2781829]: Using jsonlite for JSON processing
2020-09-29T09:52:53.512922+00:00 shinyapps[2781829]: RJSONIO version: (none)
2020-09-29T09:52:53.512938+00:00 shinyapps[2781829]: htmltools version: 0.5.0
2020-09-29T09:52:53.513072+00:00 shinyapps[2781829]: Using pandoc: /opt/connect/ext/pandoc2
2020-09-29T09:52:53.684513+00:00 shinyapps[2781829]:
2020-09-29T09:52:53.684515+00:00 shinyapps[2781829]: Starting R with process ID: '154'
2020-09-29T09:52:53.758031+00:00 shinyapps[2781829]:
2020-09-29T09:52:53.758032+00:00 shinyapps[2781829]: Listening on http://127.0.0.1:43265

And nothing after that.

You don't get an "attempting to reconnect" at the bottom left of the screen?

Screen Shot 2020-09-29 at 11 53 35

@trafficonese
Copy link
Contributor

Oh sry I think I checked my local app.
So yes indeed, I see that panel flashing but the app seems functional somehow.

What if you replace all & with \u0026 and all backticks with normal ticks?

@psimm
Copy link
Author

psimm commented Sep 29, 2020

Sorry I can't test that right now, I will get back to it tomorrow evening.

@psimm
Copy link
Author

psimm commented Sep 30, 2020

Do you mean to change the tree to this?

tree <- list( 
  A = structure(list( 
    'Gifts \u0026 Sets' = structure(0, stselected = TRUE), 
    Jewellery = structure(0, stselected = TRUE), 
    'Socks \u0026 Tights' = structure(0, stselected = TRUE), 
    Tweezers = structure(0, stselected = TRUE) 
  ), stselected = TRUE), 
  B = structure(list( 
    'Gifts \u0026 Sets' = structure(0, stselected = TRUE), 
    'Hand \u0026 Feet' = structure(list( 
      Treatments = structure(0, stselected = TRUE) 
    ), stselected = TRUE) 
  ), stselected = TRUE)) 

I have made that change and uploaded it to Shinyapps.io. Here is the app: https://psim.shinyapps.io/shinytree_test2/

@trafficonese
Copy link
Contributor

Ok, that didn't help. The problem doesn't come from the & character.
I created another app, with this tree and didn't get any disconnects:

tree <- list(
    A = structure(list(
        'Gifts & Sets' = structure(0, stselected = TRUE),
        Jewellery = structure(0, stselected = TRUE),
        'Socks & Tights' = structure(0, stselected = TRUE)
    ), stselected = TRUE),
    B = structure(list(
        'Gifts ! Sets' = structure(0, stselected = TRUE),
        Jewellery = structure(0, stselected = TRUE),
        'Socks $ Tights' = structure(0, stselected = TRUE)
    ), stselected = TRUE)
)

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

2 participants