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
How to properly close the Chromote session in a package? #109
Comments
I've just seen this SO thread and then I tried: parentBrowser <- session$parent$get_browser()
on.exit(parentBrowser$close()) Then the package works but I get this message:
|
This throws a true R error. And RCMD Check complains that there are connections style open at the end. |
I get that when I check my package:
|
I know why this error occurs. The function () {
private$is_active_ <- FALSE
self$Browser$close()
} And the if (!private$is_active_) {
stop("Chromote object is closed.")
} Hence the error. |
Thanks for the investigation into the problem! I've just pushed a fix for it. |
Thanks! Does this fix solves the RCMD Check problem with the unclosed connection ? Oddly, I don't have this problem when I RCMD Check on my Windows laptop, but it occurs on Ubuntu in the Github action. |
Hm, I'm not sure about Update: I just pushed a commit to trigger the GHA workflow. |
I've just tested your fix and |
That just happens to be the value of the last expression in the function. Do you think it should return something else? |
|
OK, I just pushed a change so that it returns |
Hello,
I've made a RStudio addin with chromote (it uses a JavaScript library to reindent some code).
I do as follows to close the Chromote session:
Is it ok? I read somewhere that to really shut down the session, one has to do
session$parent$close()
. But if I do that my package does not work, I get the error Chromote object is closed.The text was updated successfully, but these errors were encountered: