Fix: should remember already reported events
This commit is contained in:
parent
0f3f2b164e
commit
2bbb49bdd3
|
@ -201,6 +201,10 @@ class DecryptionFailureTracker @Inject constructor(
|
||||||
// already tracked
|
// already tracked
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (alreadyReported.contains(eventId)) {
|
||||||
|
// already reported
|
||||||
|
return
|
||||||
|
}
|
||||||
val isOwnIdentityTrusted = session.cryptoService().crossSigningService().isCrossSigningVerified()
|
val isOwnIdentityTrusted = session.cryptoService().crossSigningService().isCrossSigningVerified()
|
||||||
val userHS = MatrixPatterns.extractServerNameFromId(session.myUserId)
|
val userHS = MatrixPatterns.extractServerNameFromId(session.myUserId)
|
||||||
val messageSenderHs = event.senderId?.let { MatrixPatterns.extractServerNameFromId(it) }
|
val messageSenderHs = event.senderId?.let { MatrixPatterns.extractServerNameFromId(it) }
|
||||||
|
|
|
@ -376,9 +376,12 @@ class DecryptionFailureTrackerTest {
|
||||||
verify(exactly = 1) { fakeAnalyticsTracker.capture(any()) }
|
verify(exactly = 1) { fakeAnalyticsTracker.capture(any()) }
|
||||||
|
|
||||||
decryptionFailureTracker.onEventDecryptionError(event, aUISIError)
|
decryptionFailureTracker.onEventDecryptionError(event, aUISIError)
|
||||||
|
|
||||||
runCurrent()
|
runCurrent()
|
||||||
|
|
||||||
|
// advance time by 7 seconds, to be ahead of the grace period
|
||||||
|
currentFakeTime += 7_000
|
||||||
|
fakeClock.givenEpoch(currentFakeTime)
|
||||||
|
|
||||||
decryptionFailureTracker.onEventDecrypted(event, emptyMap())
|
decryptionFailureTracker.onEventDecrypted(event, emptyMap())
|
||||||
runCurrent()
|
runCurrent()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue