In gar_auth() condition for scopes is computed by a use && that can conduct to coercion errors, ie:
Error in !is.null(scopes) && scopes != "": 'length(x) = 2 > 1' in coercion to 'logical(1)'
Steps to reproduce the problem
highlight_gar_auth_issue <- function() {
# this will activate signals for the reported issue
withr::local_envvar(c(`_R_CHECK_LENGTH_1_LOGIC2_` = "true"))
# this is to avoid changes in local system
# Note: scopes can be more than one (eg, in my system they are five)
old_opt <- options(googleAuthR.scopes.selected = c("foo", "bar"))
withr::defer(options(old_opt))
googleAuthR::gar_auth()
}
highlight_gar_auth_issue()
Expected output
Not the thrown the reported error.
Actual output
Before you run your code, please run:
options(googleAuthR.verbose=2) and copy-paste the console output here.
Check it doesn't include any sensitive info like auth tokens or accountIds - you can usually just edit those out manually and replace with say XXX
withr::with_envvar(c(`_R_CHECK_LENGTH_1_LOGIC2_` = "true"), {
old_opt <- options(
googleAuthR.verbose = 2,
googleAuthR.scopes.selected = c("foo", "bar")
)
withr::defer(options(old_opt))
googleAuthR::gar_auth()
})
#> Setting deferred event(s) on global environment.
#> * Execute (and clear) with `deferred_run()`.
#> * Clear (without executing) with `deferred_clear()`.
#> Error in !is.null(scopes) && scopes != "": 'length(x) = 2 > 1' in coercion to 'logical(1)'
Session Info
Please run sessionInfo() so we can check what versions of packages you have installed
What goes wrong
In
gar_auth()
condition for scopes is computed by a use&&
that can conduct to coercion errors, ie:Steps to reproduce the problem
Expected output
Not the thrown the reported error.
Actual output
Before you run your code, please run:
options(googleAuthR.verbose=2)
and copy-paste the console output here.Check it doesn't include any sensitive info like auth tokens or accountIds - you can usually just edit those out manually and replace with say
XXX
Session Info
Please run
sessionInfo()
so we can check what versions of packages you have installed