riskassessment icon indicating copy to clipboard operation
riskassessment copied to clipboard

PDF reports downloaded to temp folder on macOS.

Open imran3004 opened this issue 2 years ago • 11 comments

When using the download PDF report option, there is no pop-up for choosing the folder and the report is downloaded to the /tmp folder.

System Info -

  • macOS Monterey v12.2.1
  • aarch64-apple-darwin20 (64-bit)
  • R version 4.2.2 (2022-10-31)

imran3004 avatar Dec 01 '22 04:12 imran3004

I am able to reproduce this issue with the following steps:

  1. Clone repo and checkout dev
  2. Install dependencies with devtools::install_dev_deps()
  3. Run app via dev/run_dev.R within RStudio
  4. Create pkgs in DB by uploading data-raw/upload_format.csv
  5. Select dplyr pkg, navigate to Report Preview tab, and click Download Report

I noticed the download path was in an RStudio-specific temp directory (~/.local/share/rstudio/tmp/ in my case). Wondering if this may be an RStudio-specific error, I tried running the app from the terminal by executing Rscript dev/run_dev.R from the root of the repo.

The bug seems to go away when executing the application from the terminal. @imran3004 -- can you try this approach and let me know what behavior you see?

borgmaan avatar Dec 21 '22 03:12 borgmaan

@borgmaan I ran the app without using RStudio and the PDF report gets downloaded to my Downloads folder. Do you see the same behaviour at your end?

While this is better than the file being stored in a random tmp folder, the desired behaviour is to have a pop-up that allows the user to select the folder to which the report is downloaded.

imran3004 avatar Dec 21 '22 15:12 imran3004

Here's the behavior and environment details for both an M1 and Intel mac using the Chrome browser. Both show file dialog windows that allow me to choose a file when running Rscript dev/run_dev.R.

Do we have another mac user who can test? Was it @ScottSchumacker?

Intel Mac

Screenshot

Screen Shot 2022-12-21 at 11 34 09 AM

devtools::session_info

> devtools::session_info()
─ Session info ─────────────────────────────────────────────────────────────────────────────────
setting  value
version  R version 4.2.1 (2022-06-23)
os       macOS Big Sur ... 10.16
system   x86_64, darwin17.0
ui       X11
language (EN)
collate  en_US.UTF-8
ctype    en_US.UTF-8
tz       America/Detroit
date     2022-12-21
pandoc   NA

─ Packages ─────────────────────────────────────────────────────────────────────────────────────
package     * version date (UTC) lib source
cachem        1.0.6   2021-08-19 [1] CRAN (R 4.2.0)
callr         3.7.3   2022-11-02 [1] CRAN (R 4.2.0)
cli           3.5.0   2022-12-20 [1] CRAN (R 4.2.1)
crayon        1.5.2   2022-09-29 [1] CRAN (R 4.2.0)
devtools      2.4.5   2022-10-11 [1] CRAN (R 4.2.0)
digest        0.6.31  2022-12-11 [1] CRAN (R 4.2.0)
ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.2.0)
fastmap       1.1.0   2021-01-25 [1] CRAN (R 4.2.0)
fs            1.5.2   2021-12-08 [1] CRAN (R 4.2.0)
glue          1.6.2   2022-02-24 [1] CRAN (R 4.2.0)
htmltools     0.5.4   2022-12-07 [1] CRAN (R 4.2.0)
htmlwidgets   1.6.0   2022-12-15 [1] CRAN (R 4.2.0)
httpuv        1.6.7   2022-12-14 [1] CRAN (R 4.2.0)
later         1.3.0   2021-08-18 [1] CRAN (R 4.2.0)
lifecycle     1.0.3   2022-10-07 [1] CRAN (R 4.2.0)
magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.2.0)
memoise       2.0.1   2021-11-26 [1] CRAN (R 4.2.0)
mime          0.12    2021-09-28 [1] CRAN (R 4.2.0)
miniUI        0.1.1.1 2018-05-18 [1] CRAN (R 4.2.0)
pkgbuild      1.4.0   2022-11-27 [1] CRAN (R 4.2.0)
pkgload       1.3.2   2022-11-16 [1] CRAN (R 4.2.0)
prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.2.0)
processx      3.8.0   2022-10-26 [1] CRAN (R 4.2.0)
profvis       0.3.7   2020-11-02 [1] CRAN (R 4.2.0)
promises      1.2.0.1 2021-02-11 [1] CRAN (R 4.2.0)
ps            1.7.2   2022-10-26 [1] CRAN (R 4.2.0)
purrr         1.0.0   2022-12-20 [1] CRAN (R 4.2.1)
R6            2.5.1   2021-08-19 [1] CRAN (R 4.2.0)
Rcpp          1.0.9   2022-07-08 [1] CRAN (R 4.2.0)
remotes       2.4.2   2021-11-30 [1] CRAN (R 4.2.0)
rlang         1.0.6   2022-09-24 [1] CRAN (R 4.2.0)
sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.2.0)
shiny         1.7.4   2022-12-15 [1] CRAN (R 4.2.0)
stringi       1.7.8   2022-07-11 [1] CRAN (R 4.2.0)
stringr       1.5.0   2022-12-02 [1] CRAN (R 4.2.0)
urlchecker    1.0.1   2021-11-30 [1] CRAN (R 4.2.0)
usethis       2.1.6   2022-05-25 [1] CRAN (R 4.2.0)
vctrs         0.5.1   2022-11-16 [1] CRAN (R 4.2.0)
xtable        1.8-4   2019-04-21 [1] CRAN (R 4.2.0)
M1 Mac

Screenshot

Screen Shot 2022-12-21 at 11 55 43 AM

devtools::session_info

Session info ─────────────────────────────────────────────────────────────────────────────────
setting  value
version  R version 4.2.2 (2022-10-31)
os       macOS Ventura 13.0.1
system   aarch64, darwin21.6.0
ui       unknown
language (EN)
collate  en_US.UTF-8
ctype    en_US.UTF-8
tz       America/Detroit
date     2022-12-21
pandoc   NA

─ Packages ─────────────────────────────────────────────────────────────────────────────────────
package     * version date (UTC) lib source
cachem        1.0.6   2021-08-19 [1] CRAN (R 4.2.2)
callr         3.7.3   2022-11-02 [1] CRAN (R 4.2.2)
cli           3.5.0   2022-12-20 [1] CRAN (R 4.2.2)
crayon        1.5.2   2022-09-29 [1] CRAN (R 4.2.2)
devtools      2.4.5   2022-10-11 [1] CRAN (R 4.2.2)
digest        0.6.31  2022-12-11 [1] CRAN (R 4.2.2)
ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.2.2)
fastmap       1.1.0   2021-01-25 [1] CRAN (R 4.2.2)
fs            1.5.2   2021-12-08 [1] CRAN (R 4.2.2)
glue          1.6.2   2022-02-24 [1] CRAN (R 4.2.2)
htmltools     0.5.4   2022-12-07 [1] CRAN (R 4.2.2)
htmlwidgets   1.6.0   2022-12-15 [1] CRAN (R 4.2.2)
httpuv        1.6.7   2022-12-14 [1] CRAN (R 4.2.2)
later         1.3.0   2021-08-18 [1] CRAN (R 4.2.2)
lifecycle     1.0.3   2022-10-07 [1] CRAN (R 4.2.2)
magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.2.2)
memoise       2.0.1   2021-11-26 [1] CRAN (R 4.2.2)
mime          0.12    2021-09-28 [1] CRAN (R 4.2.2)
miniUI        0.1.1.1 2018-05-18 [1] CRAN (R 4.2.2)
pkgbuild      1.4.0   2022-11-27 [1] CRAN (R 4.2.2)
pkgload       1.3.2   2022-11-16 [1] CRAN (R 4.2.2)
prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.2.2)
processx      3.8.0   2022-10-26 [1] CRAN (R 4.2.2)
profvis       0.3.7   2020-11-02 [1] CRAN (R 4.2.2)
promises      1.2.0.1 2021-02-11 [1] CRAN (R 4.2.2)
ps            1.7.2   2022-10-26 [1] CRAN (R 4.2.2)
purrr         1.0.0   2022-12-20 [1] CRAN (R 4.2.2)
R6            2.5.1   2021-08-19 [1] CRAN (R 4.2.2)
Rcpp          1.0.9   2022-07-08 [1] CRAN (R 4.2.2)
remotes       2.4.2   2021-11-30 [1] CRAN (R 4.2.2)
rlang         1.0.6   2022-09-24 [1] CRAN (R 4.2.2)
sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.2.2)
shiny         1.7.4   2022-12-15 [1] CRAN (R 4.2.2)
stringi       1.7.8   2022-07-11 [1] CRAN (R 4.2.2)
stringr       1.5.0   2022-12-02 [1] CRAN (R 4.2.2)
urlchecker    1.0.1   2021-11-30 [1] CRAN (R 4.2.2)
usethis       2.1.6   2022-05-25 [1] CRAN (R 4.2.2)
vctrs         0.5.1   2022-11-16 [1] CRAN (R 4.2.2)
xtable        1.8-4   2019-04-21 [1] CRAN (R 4.2.2)

borgmaan avatar Dec 21 '22 16:12 borgmaan

Ah @borgmaan ! I see that you're using the Chrome browser. I am using Safari. Do you get the desired pop-up with Safari?

imran3004 avatar Dec 21 '22 17:12 imran3004

I believe this is the default Safari behavior. You can have Safari prompt for a download location by changing File download location in the browser Preferences:

Screen Shot 2022-12-21 at 1 19 29 PM

If you are aligned, I think we are OK to close this as it is not a bug.

borgmaan avatar Dec 21 '22 18:12 borgmaan

@borgmaan so this may only be an issue if the app is used through Safari or launched from RStudio.

I suggest we discuss with the team in our next meeting to understand how most users interact with the app, whether it is through Chrome, Safari, from RStudio etc. and based on that we decide on next steps.

imran3004 avatar Dec 22 '22 15:12 imran3004

Hi @borgmaan and @imran3004, after looking at this issue again, I noticed something interesting. For some packages, the file download location pop up appears but for other packages, the report is automatically downloaded either to downloads or to the tmp folder. I will bring this up in todays meeting.

ScottSchumacker avatar Jan 05 '23 15:01 ScottSchumacker

For further investigation: @imran3004 to try DBI (download window popup) & dplyr (temp folder). Secondly, try to modify your Safari preferences like @borgmaan points out above.

AARON-CLARK avatar Jan 05 '23 16:01 AARON-CLARK

Hi @imran3004, any progress on this one?

AARON-CLARK avatar Jan 24 '23 12:01 AARON-CLARK

Hi @imran3004, I want to remove this issue from our project roadmap since it's a bit stale. If you have an update, please let us know. Or if you conclude the issue is out of scope (i.e. not unique or solvable by riskassessment), let's close it. Your thoughts?

AARON-CLARK avatar Mar 14 '23 11:03 AARON-CLARK

@AARON-CLARK , I have not been able to solve it. Let's park this away for the time being as it is not critical.

imran3004 avatar Mar 14 '23 15:03 imran3004

Closing since we don't plan to do any other work on this one. If we need it in the future, please feel free to re-open.

aclark02-arcus avatar Jul 03 '24 16:07 aclark02-arcus