Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Bisaloo
Copy link

@Bisaloo Bisaloo commented Aug 28, 2025

I see that this change was made in other r-lib repos so I thought I'd suggest it here as well.

tools::R_user_dir() was introduced in R 4.0 so safe to use with the tidyverse R version support policy/

@hadley
Copy link
Member

hadley commented Aug 28, 2025

I think this probably needs a bit more thought than in other packages, because we'd need to make sure that this directory eventually gets cleaned up.

@Bisaloo
Copy link
Author

Bisaloo commented Aug 29, 2025

But I don't see any mechanism in rappdirs to clean up. My understanding is that the user or the OS takes care of this. In which case, the situation should be the same with the folder created by tools::R_user_dir().

As far as I understand, the main difference between rappdirs and tools::R_user_dir() is that rappdirs covers the different cases (config, cache, etc.) via different functions while tools::R_user_dir() does it via its which argument.

Am I missing something?

@hadley
Copy link
Member

hadley commented Aug 29, 2025

httr2 has cache_disk_prune() which is called automatically on load, and ensures that all tokens > 30 days old are deleted. These tokens can be used to do stuff on your behalf so I wanted to avoid having them lay around for an unlimited amount of time.

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

Successfully merging this pull request may close these issues.

2 participants