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

runGist in a function #3309

Closed
helgasoft opened this issue Feb 26, 2021 · 2 comments
Closed

runGist in a function #3309

helgasoft opened this issue Feb 26, 2021 · 2 comments

Comments

@helgasoft
Copy link

@helgasoft helgasoft commented Feb 26, 2021

System details

Browser Version: Chrome Version 88.0.4324.190 (Official Build) (64-bit)
Working in RStudio Version 1.4.1103.

Output of sessionInfo():

R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.3   assertthat_0.2.1 cli_2.3.0        tools_4.0.3     
[5] glue_1.4.2       yaml_2.2.1       rlang_0.4.10 

Example application or steps to reproduce the problem

fun <- function() {
  if (interactive())
    shiny::runGist('6c33ee09a16d55569c562f7aa3951088')
}
fun()

Describe the problem in detail

When running any gist from a function, exiting/closing the Shiny window pops a breakpoint in the Console:
Called from: top level
then after clicking Stop, comes another one
Called from: execCallbacks(timeoutSecs, all, loop$id)
and after stopping again everything is back to normal.
This is confusing to all users.
Any solution to make those breakpoints disappear?

@wch
Copy link
Collaborator

@wch wch commented Feb 26, 2021

I'm not able to reproduce this problem.

The behavior you're describing sounds exactly like what happens if options(error=browser) has been set before running the Shiny app.

Here's a screenshot of what happens after starting and quitting the app, with options(error=browser), and then with the option unset with options(error=NULL):

image

@helgasoft
Copy link
Author

@helgasoft helgasoft commented Feb 26, 2021

Thank you, Winston! Indeed this is the cause. We set this option thru RStudio.
RStudio > Debug > On Error has 3 options: "Message only", "Error Inspector" and "Break in Code".
The first two do not interrupt the exit, but "Break in Code" does.

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