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

httr 1.3.0 does not cache to .httr-oauth file nor use it #475

Closed
tjpalanca opened this issue Aug 17, 2017 · 7 comments
Closed

httr 1.3.0 does not cache to .httr-oauth file nor use it #475

tjpalanca opened this issue Aug 17, 2017 · 7 comments

Comments

@tjpalanca
Copy link

I'm using gmailr to send mail via the gmail API. As far as I know, OAuth 2.0 is handled via httr.

When I upgraded to httr 1.3.0 it seemed that the cache file .httr-oauth was no longer saving, nor was it used when it was in the working directory. I downgrade to 1.2.1 and everything is fine.

Unfortunately I can't find a way to make it a reproducible example but this is what i do:

# SETUP: There is already an .httr-oauth file in the working directory

# Install 1.2.1
library(devtools)
install_version("httr", "1.2.1")

library(gmailr)
library(httr)
options(httr_oauth_cache = TRUE, httr_oob_default = TRUE)
gmail_auth()

# DO: Restart R Session

# Install 1.3.0
library(devtools)
install.packages("httr")

library(gmailr)
library(httr)
options(httr_oauth_cache = TRUE, httr_oob_default = TRUE)
gmail_auth()

When you install 1.3.0, it again requests for notification. When you install 1.2.1 again, it just used the cache file.

I haven't gotten to looking at diffs to see what changed, but putting this up here in case other people are experiencing an issue.

@tjpalanca tjpalanca changed the title httr 1.3.0 does not cache httr 1.3.0 does not cache to .httr-oauth file nor use it Aug 17, 2017
@naltmann
Copy link

I also experienced this problem. Downgrading to 1.2.0 fixed it immediately, and everything worked as expected.

@jennybc
Copy link
Member

jennybc commented Aug 17, 2017

I believe I found the change that had this effect ☝️. At least my git bisect exercise suggests so and it also makes sense (note the cache_path = FALSE here, whereas the previous version was cache_path = cache).

httr/R/oauth-token.r

Lines 230 to 236 in badb033

Token2.0$new(
app = app,
endpoint = endpoint,
params = params,
credentials = credentials,
cache_path = FALSE
)

The dev version just prior seems ok wrt @tjpalanca's reprex:

install_github("r-lib/httr@99b256c0a12b91f9d6e7580d5f6b70703970bf18")

@hadley
Copy link
Member

hadley commented Aug 17, 2017

I'll do a fix and release a patch version tomorrow

@hadley hadley closed this as completed in 8608fca Aug 18, 2017
@hadley
Copy link
Member

hadley commented Aug 18, 2017

Just fixed - I'd really appreciate it if someone else would test it before I re-release

@jennybc
Copy link
Member

jennybc commented Aug 18, 2017

It looks like everything is back in business to me! 👍

@tjpalanca
Copy link
Author

Tested, and good with me. Much appreciated. :)

@hadley
Copy link
Member

hadley commented Aug 18, 2017

Thanks! I'll submit shortly

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

4 participants