Do not remove spotify access token on invalid_grant error #1921
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We used to remove spotify access tokens from our database whenever we detected token revocation at one point. But one day spotify had a downtime while resulted in false revocation errors, and we ended up deleting most of our users' spotify access tokens. Now we don't remove the token from database, this is more resilient and without downsides. If a user actually revoked their token, then its useless anyway so doesn't matter if we remove it. And if it is a false revocation error, we are saved! :) In any case, we do set an error message for the user in the database so that we can skip in future runs and notify them to reconnect if they want.