@@ -696,28 +696,27 @@ class MegolmEncryption extends EncryptionAlgorithm {
696
696
) : Promise < void > {
697
697
const obSessionInfo = this . outboundSessions [ sessionId ] ;
698
698
if ( ! obSessionInfo ) {
699
- logger . debug ( `megolm session ${ sessionId } not found: not re-sharing keys` ) ;
699
+ logger . debug ( `megolm session ${ senderKey } | ${ sessionId } not found: not re-sharing keys` ) ;
700
700
return ;
701
701
}
702
702
703
703
// The chain index of the key we previously sent this device
704
704
if ( obSessionInfo . sharedWithDevices [ userId ] === undefined ) {
705
- logger . debug ( `megolm session ${ sessionId } never shared with user ${ userId } ` ) ;
705
+ logger . debug ( `megolm session ${ senderKey } | ${ sessionId } never shared with user ${ userId } ` ) ;
706
706
return ;
707
707
}
708
708
const sessionSharedData = obSessionInfo . sharedWithDevices [ userId ] [ device . deviceId ] ;
709
709
if ( sessionSharedData === undefined ) {
710
710
logger . debug (
711
- "megolm session ID " + sessionId + " never shared with device " +
712
- userId + ":" + device . deviceId ,
711
+ `megolm session ${ senderKey } |${ sessionId } never shared with device ${ userId } :${ device . deviceId } ` ,
713
712
) ;
714
713
return ;
715
714
}
716
715
717
716
if ( sessionSharedData . deviceKey !== device . getIdentityKey ( ) ) {
718
717
logger . warn (
719
- `Session has been shared with device ${ device . deviceId } but with identity ` +
720
- `key ${ sessionSharedData . deviceKey } . Key is now ${ device . getIdentityKey ( ) } !` ,
718
+ `Megolm session ${ senderKey } | ${ sessionId } has been shared with device ${ device . deviceId } but ` +
719
+ `with identity key ${ sessionSharedData . deviceKey } . Key is now ${ device . getIdentityKey ( ) } !` ,
721
720
) ;
722
721
return ;
723
722
}
@@ -730,7 +729,7 @@ class MegolmEncryption extends EncryptionAlgorithm {
730
729
731
730
if ( ! key ) {
732
731
logger . warn (
733
- `No inbound session key found for megolm ${ sessionId } : not re-sharing keys` ,
732
+ `No inbound session key found for megolm session ${ senderKey } | ${ sessionId } : not re-sharing keys` ,
734
733
) ;
735
734
return ;
736
735
}
@@ -776,7 +775,7 @@ class MegolmEncryption extends EncryptionAlgorithm {
776
775
[ device . deviceId ] : encryptedContent ,
777
776
} ,
778
777
} ) ;
779
- logger . debug ( `Re-shared key for megolm session ${ sessionId } with ${ userId } :${ device . deviceId } ` ) ;
778
+ logger . debug ( `Re-shared key for megolm session ${ senderKey } | ${ sessionId } with ${ userId } :${ device . deviceId } ` ) ;
780
779
}
781
780
782
781
/**
@@ -1902,10 +1901,11 @@ class MegolmDecryption extends DecryptionAlgorithm {
1902
1901
public async sendSharedHistoryInboundSessions ( devicesByUser : Record < string , DeviceInfo [ ] > ) : Promise < void > {
1903
1902
await olmlib . ensureOlmSessionsForDevices ( this . olmDevice , this . baseApis , devicesByUser ) ;
1904
1903
1905
- logger . log ( "sendSharedHistoryInboundSessions to users" , Object . keys ( devicesByUser ) ) ;
1906
-
1907
1904
const sharedHistorySessions = await this . olmDevice . getSharedHistoryInboundGroupSessions ( this . roomId ) ;
1908
- logger . log ( "shared-history sessions" , sharedHistorySessions ) ;
1905
+ logger . log (
1906
+ `Sharing history in ${ this . roomId } with users ${ Object . keys ( devicesByUser ) } ` ,
1907
+ sharedHistorySessions . map ( ( [ senderKey , sessionId ] ) => `${ senderKey } |${ sessionId } ` ) ,
1908
+ ) ;
1909
1909
for ( const [ senderKey , sessionId ] of sharedHistorySessions ) {
1910
1910
const payload = await this . buildKeyForwardingMessage ( this . roomId , senderKey , sessionId ) ;
1911
1911
0 commit comments