Add comments to explain why we remove RRPs early

This commit is contained in:
Ravi Khadiwala authored and ravi-signal committed 2026-04-09 16:35:08 -05:00
1 parent 3930b1841e
commit 95843529ba
1 file changed
+8
@@ -782,6 +782,10 @@ public class VerificationController {
boolean existingRRP = false;
if (resultSession.verified()) {
// Since there is a valid verification session we invalidate the other possible verification mechanism,
// the RRP. It's possible the client will not actually be able to register (e.g. failed reglock challenge), and
// so we will have removed the RRP unnecessarily. The impact of this is low, since the owner of the RRP
// can always just fallback to session-based verification.
existingRRP = registrationRecoveryPasswordsManager.remove(phoneNumberIdentifiers.getPhoneNumberIdentifier(registrationServiceSession.number()).join()).join();
}
@@ -854,6 +858,10 @@ public class VerificationController {
.orElseThrow(NotFoundException::new);
if (registrationServiceSession.verified()) {
// Since there is a valid verification session we invalidate the other possible verification mechanism,
// the RRP. It's possible the client will not actually be able to register (e.g. failed reglock challenge), and
// so we will have removed the RRP unnecessarily. The impact of this is low, since the owner of the RRP
// can always just fallback to session-based verification.
registrationRecoveryPasswordsManager.remove(phoneNumberIdentifiers.getPhoneNumberIdentifier(registrationServiceSession.number()).join()).join();
}