Closed GeoffreyHuck closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
21b116c
) to head (644b514
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Related to #1022
We delete the expired tokens of the user when a user's session is refreshed. This replaces the old rule that deleted all the tokens, even non-expired ones, except the one used to refresh (and the new one of course).
Note: we don't delete the expired tokens if there's an error during the refresh to avoid having weird side effects.
New query - No index required
That's the new query to delete the expired tokens:
sessions.session_id
is a primary keysessions.user_id
is a foreign keyaccess_tokens.session_id
is covered by the existing indexsession_id_expires_at
access_tokens.expires_at
is covered by the existing indexexpires_at
-> So there no need to add an indexReview
Easier to review all at once. Details are in commit messages.