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

Error in curl::curl_fetch_memory(url, handle = handle) : <url> malformed #191

Closed
shalutiwari opened this issue Apr 17, 2018 · 4 comments · Fixed by #346
Closed

Error in curl::curl_fetch_memory(url, handle = handle) : <url> malformed #191

shalutiwari opened this issue Apr 17, 2018 · 4 comments · Fixed by #346
Labels
bug an unexpected problem or unintended behavior ShinyDriver 🏎️

Comments

@shalutiwari
Copy link

shalutiwari commented Apr 17, 2018

Getting this error when running below mytest.R . Error goes away when download lines are commented.

app <- ShinyDriver$new("../", shinyOptions = list(display.mode = "normal"))
app$snapshotInit("mytest")

app$snapshot()
app$snapshot()
app$snapshot()
app$setInputs(sanitize = "TRUE")
app$snapshot()
app$snapshotDownload("downloadData")
app$setInputs(safe = "TRUE")
app$snapshotDownload("downloadData")
recordTest('110-error-sanitization',shinyOptions = list(display.mode="normal"))
Loading required package: shiny

Listening on http://127.0.0.1:7073
Saved test code to /Users/shalutiwari/shiny-examples-branch/shiny-examples/110-error-sanitization/tests/mytest.R
Running mytest.R Error in curl::curl_fetch_memory(url, handle = handle) : <url> malformed
@hadley
Copy link
Member

hadley commented Aug 12, 2020

I don't see any error when running:

path <- "../shiny-examples/110-error-sanitization"
shinytest::recordTest(path)

So maybe it's that test that's the problem? Ok, yes, this generates the error:

path <- "../shiny-examples/110-error-sanitization"
dir.create(file.path(path, "tests", "shinytest"), recursive = TRUE)
writeLines(con = file.path(path, "tests", "shinytest", "mytest.R"),  '
app <- ShinyDriver$new("../../")
app$snapshotInit("mytest")
app <- ShinyDriver$new("../../")
app$snapshotInit("mytest")
app$snapshotDownload("downloadData")
')
shinytest::testApp(path)

@hadley
Copy link
Member

hadley commented Aug 12, 2020

And this is because self$findElement(paste0("#", id))$getAttribute("href") returns "". So we need to provide an informative error here, either checking that href exists or checking that httr::GET() succeeds (or both).

@hadley hadley added bug an unexpected problem or unintended behavior ShinyDriver 🏎️ labels Aug 12, 2020
@hadley
Copy link
Member

hadley commented Aug 12, 2020

Same underlying cause as #195

@hadley hadley unassigned wch Aug 13, 2020
@hadley
Copy link
Member

hadley commented Aug 14, 2020

Simpler reprex:

app <- ShinyDriver$new("../shiny-examples/110-error-sanitization")
app$snapshotInit("mytest")
app$snapshotDownload("downloadData")

hadley added a commit that referenced this issue Aug 14, 2020
Includes some improvements to `$snapshotDownload()` docs which I required to understand what was going wrong.

Fixes #191. Fixes #192.
hadley added a commit that referenced this issue Aug 19, 2020
Includes some improvements to `$snapshotDownload()` docs which I required to understand what was going wrong.

Fixes #191. Fixes #192.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior ShinyDriver 🏎️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants