Skip to content

Commit 475f5dd

Browse files
mmyzwlclaude
andcommitted
fix(matrix): clear exhausted decrypt retries on crypto signal
When Matrix decryption fails with MEGOLM_UNKNOWN_INBOUND_SESSION_ID ('The sender's device has not sent us the keys'), the decrypt bridge retries up to 8 times before permanently marking the event as exhausted in exhaustedDecryptRetries. After this point, even when crypto signals arrive that could indicate new keys are available (KeyBackupDecryptionKeyCached, RehydrationCompleted, DevicesUpdated, KeysChanged), retryPendingNow() returns immediately because decryptRetries is empty. This causes Matrix communication to stall until a gateway restart, as previously exhausted events can never be retried. Fix: clear exhaustedDecryptRetries and failedDecryptionsNotified when crypto signals fire, allowing events to be retried after new keys potentially become available. Closes #93501 Co-Authored-By: Claude <[email protected]>
1 parent a664c44 commit 475f5dd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎extensions/matrix/src/matrix/sdk/decrypt-bridge.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ export class MatrixDecryptBridge<TRawEvent extends DecryptBridgeRawEvent> {
148148
this.cryptoRetrySignalsBound = true;
149149

150150
const trigger = (reason: string): void => {
151+
this.exhaustedDecryptRetries.clear();
152+
this.failedDecryptionsNotified.clear();
151153
this.retryPendingNow(reason);
152154
};
153155

0 commit comments

Comments
 (0)