@@ -485,7 +485,7 @@ async fn migrate_threepids(
485
485
. into_extract_localpart ( synapse_user_id. clone ( ) ) ?
486
486
. to_owned ( ) ;
487
487
let Some ( user_infos) = state. users . get ( username. as_str ( ) ) . copied ( ) else {
488
- // HACK(matrix.org): we seem to have many threepids for unknown users
488
+ // HACK(matrix.org): we seem to have casing inconsistencies
489
489
if state. users . contains_key ( username. to_lowercase ( ) . as_str ( ) ) {
490
490
tracing:: warn!( mxid = %synapse_user_id, "Threepid found in the database matching an MXID with the wrong casing" ) ;
491
491
continue ;
@@ -583,6 +583,12 @@ async fn migrate_external_ids(
583
583
. into_extract_localpart ( synapse_user_id. clone ( ) ) ?
584
584
. to_owned ( ) ;
585
585
let Some ( user_infos) = state. users . get ( username. as_str ( ) ) . copied ( ) else {
586
+ // HACK(matrix.org): we seem to have casing inconsistencies
587
+ if state. users . contains_key ( username. to_lowercase ( ) . as_str ( ) ) {
588
+ tracing:: warn!( mxid = %synapse_user_id, "External ID found in the database matching an MXID with the wrong casing" ) ;
589
+ continue ;
590
+ }
591
+
586
592
return Err ( Error :: MissingUserFromDependentTable {
587
593
table : "user_external_ids" . to_owned ( ) ,
588
594
user : synapse_user_id,
@@ -680,6 +686,12 @@ async fn migrate_devices(
680
686
. into_extract_localpart ( synapse_user_id. clone ( ) ) ?
681
687
. to_owned ( ) ;
682
688
let Some ( user_infos) = state. users . get ( username. as_str ( ) ) . copied ( ) else {
689
+ // HACK(matrix.org): we seem to have casing inconsistencies
690
+ if state. users . contains_key ( username. to_lowercase ( ) . as_str ( ) ) {
691
+ tracing:: warn!( mxid = %synapse_user_id, "Device found in the database matching an MXID with the wrong casing" ) ;
692
+ continue ;
693
+ }
694
+
683
695
return Err ( Error :: MissingUserFromDependentTable {
684
696
table : "devices" . to_owned ( ) ,
685
697
user : synapse_user_id,
@@ -822,6 +834,12 @@ async fn migrate_unrefreshable_access_tokens(
822
834
. into_extract_localpart ( synapse_user_id. clone ( ) ) ?
823
835
. to_owned ( ) ;
824
836
let Some ( user_infos) = state. users . get ( username. as_str ( ) ) . copied ( ) else {
837
+ // HACK(matrix.org): we seem to have casing inconsistencies
838
+ if state. users . contains_key ( username. to_lowercase ( ) . as_str ( ) ) {
839
+ tracing:: warn!( mxid = %synapse_user_id, "Access token found in the database matching an MXID with the wrong casing" ) ;
840
+ continue ;
841
+ }
842
+
825
843
return Err ( Error :: MissingUserFromDependentTable {
826
844
table : "access_tokens" . to_owned ( ) ,
827
845
user : synapse_user_id,
@@ -970,6 +988,12 @@ async fn migrate_refreshable_token_pairs(
970
988
. into_extract_localpart ( synapse_user_id. clone ( ) ) ?
971
989
. to_owned ( ) ;
972
990
let Some ( user_infos) = state. users . get ( username. as_str ( ) ) . copied ( ) else {
991
+ // HACK(matrix.org): we seem to have casing inconsistencies
992
+ if state. users . contains_key ( username. to_lowercase ( ) . as_str ( ) ) {
993
+ tracing:: warn!( mxid = %synapse_user_id, "Refresh token found in the database matching an MXID with the wrong casing" ) ;
994
+ continue ;
995
+ }
996
+
973
997
return Err ( Error :: MissingUserFromDependentTable {
974
998
table : "refresh_tokens" . to_owned ( ) ,
975
999
user : synapse_user_id,
0 commit comments