Skip to content

Commit 1b63615

Browse files
committed
Don't read refresh tokens that don't have associated access tokens
These appear to be accidental and should not be migrated.
1 parent f1e4dc8 commit 1b63615

File tree

1 file changed

+1
-1
lines changed
  • crates/syn2mas/src/synapse_reader

1 file changed

+1
-1
lines changed

crates/syn2mas/src/synapse_reader/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ impl<'conn> SynapseReader<'conn> {
462462
SELECT
463463
rt0.user_id, rt0.device_id, at0.token AS access_token, rt0.token AS refresh_token, at0.valid_until_ms, at0.last_validated
464464
FROM refresh_tokens rt0
465-
LEFT JOIN access_tokens at0 ON at0.refresh_token_id = rt0.id AND at0.user_id = rt0.user_id AND at0.device_id = rt0.device_id
465+
INNER JOIN access_tokens at0 ON at0.refresh_token_id = rt0.id AND at0.user_id = rt0.user_id AND at0.device_id = rt0.device_id
466466
LEFT JOIN access_tokens at1 ON at1.refresh_token_id = rt0.next_token_id
467467
WHERE NOT at1.used OR at1.used IS NULL
468468
",

0 commit comments

Comments
 (0)