PoonLab / KaphiShiny

A Shiny web interface for running Kaphi
0 stars 0 forks source link

downloadHandler is causing some weird stuff on mac #5

Closed 0ldM4j0r closed 7 years ago

0ldM4j0r commented 7 years ago

So each time I implement a new feature i test it on both linux and mac on google chrome. Everything up to commit 8176ad9cce3fd270d3d063ecfdb0f95c30a7ec90 works fine on both, but commit c446428337f34be67ce48482983b3859161954e6 doesn't always allow Kaphi to run via shiny app on mac. This commit is what is responsible for downloading the tsv result file. Commenting out the downloadHander part (provided below) allows Kaphi to run. However, that will prevent the user from downloading the tsv file since the downloadHandler isn't there anymore.

  output$downloadTraceFile <- downloadHandler(
    filename = function() {
      sprintf("%s.tsv", uniqueTraceFileName)
    },
    content = function(file) {
      file.copy(sprintf("tmp/%s.tsv", uniqueTraceFileName), file)
    }
  )

I used this format for download handler earlier in the code to download the config file (provided below), and i works fine for both mac and linux, so I am not sure what is going on here.

  output$downloadDefaultConfigurationFile <- downloadHandler(
    filename = function() {
      paste0(input$specificModel, ".yaml")
    },
    content = function(file) {
      file.copy(paste0("configs/", input$specificModel, ".yaml"), file)
    }
  )
0ldM4j0r commented 7 years ago

This is my mistake, when I ran Kaphi through shiny on the mac i didn't refresh the directory content in Rstudio, so it seems as if nothing was being generated but a file was being generated.