[GH-ISSUE #223] Implement cache token and refresh token #74

Closed
opened 2026-02-27 20:22:58 +03:00 by kerem · 1 comment
Owner

Originally created by @ramsayleung on GitHub (Jul 9, 2021).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/223

Since we use explicitly individual functions to control whether to save the token into Json file:

  • refresh_user_token_without_cache
  • refresh_user_token(with cache implicitly)

Honestly speaking, it's clumsy but work. We are planning to improve it, since we have discussed that making it as a feature is not a good idea, I prefer to use configuration field to control. Then @marioortizmanero already added two fields to control this behavior:

pub struct Config {
    pub token_cached: bool,

    /// TODO
    pub token_refreshing: bool,
}

Since the skeleton has been constructed, I would like to supply the flesh to make the body complete.

Originally created by @ramsayleung on GitHub (Jul 9, 2021). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/223 Since we use explicitly individual functions to control whether to save the token into Json file: + `refresh_user_token_without_cache` + `refresh_user_token`(with cache implicitly) Honestly speaking, it's clumsy but work. We are planning to improve it, since we have discussed that [making it as a feature](https://github.com/ramsayleung/rspotify/issues/135) is not a good idea, I prefer to use configuration field to control. Then @marioortizmanero already added two fields to control this behavior: ```rust pub struct Config { pub token_cached: bool, /// TODO pub token_refreshing: bool, } ``` Since the skeleton has been constructed, I would like to supply the flesh to make the body complete.
kerem 2026-02-27 20:22:58 +03:00
Author
Owner

@marioortizmanero commented on GitHub (Jul 9, 2021):

Check out the last comment at #4. If you want to implement the refreshing token you'll have to use a cell/mutex so that we can mutate the token without changing the signatures. I'll close that issue on favor of this.

<!-- gh-comment-id:876998248 --> @marioortizmanero commented on GitHub (Jul 9, 2021): Check out the last comment at #4. If you want to implement the refreshing token you'll have to use a cell/mutex so that we can mutate the token without changing the signatures. I'll close that issue on favor of this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#74
No description provided.