Closed jacobspangler-agendia closed 2 years ago
@jgutman does the above surprise you?
Off the top of my head I don't know why this would be, but I'll take a look soon!
I definitely get the same 400:
httr::GET("https://www.rstudio.org/links/check_for_update?version=2022.2.2.485&os=windows&format=kvp")
#> Response [https://www.rstudio.org/links/check_for_update?version=2022.2.2.485&os=windows&format=kvp]
#> Date: 2022-06-02 22:41
#> Status: 400
#> Content-Type: text/html; charset=UTF-8
#> <EMPTY BODY>
so the question really is ... is devtools making a bad URL or does some URL that should work, not work?
No, we literally just released that patch, so that isn't the reason. I will be evaluating this, its just been busy this week. I've confirmed it gives the correct response in RStudio Desktop on Windows with 2022.2.2.485, so I'll compare and see if we are pinging the same URL with the same params -- will get back to this next week!
Okay, so I have identified the issue, and it does appear that the correct URL is not being formed. IIRC, the PR we had previously discussed, the intended approach was to call rstudioapi::versionInfo()$long_version
and use the long version in constructing the URL. Because some older versions of RStudio do not have a long version, if there was no long version, fall back to the rstudioapi::versionInfo()$version
. For the identified version, the long version is 2022.02.2+485
, and we should be using the escaped long version, rather than the (short) version
, which is 2022.2.2.485
and does not exist on the page. I'm not sure offhand why it is using the version rather than the long version, but I believe that is the source of the error
@jacobspangler-agendia do you get the same error with the latest development version of devtools
from Github? It seems like this fails using the version of devtools on CRAN, but passes if I install from Github.
Ah, yes. I haven't released devtools to CRAN since implementing the fix for this function!
https://github.com/r-lib/devtools/blob/main/NEWS.md#devtools-development-version
When I use the
devtools::dev_sitrep()
function, I'm getting a 400 bad request response:This appears similar to issue 2397