Skip to content

Commit

Permalink
Include failed attempts when determining previouslyFailedSenders
Browse files Browse the repository at this point in the history
  • Loading branch information
katherine-signal authored Jul 15, 2024
1 parent e91e950 commit 86de827
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ public CompletableFuture<RegistrationSession> sendVerificationCode(final Message
.map(RegistrationAttempt::getSenderName)
.collect(Collectors.toSet());

// Add senders from failed attempts with a "provider unavailable" error
session.getFailedAttemptsList()
.stream()
.filter(attempt -> attempt.getFailedSendReason() == FailedSendReason.FAILED_SEND_REASON_UNAVAILABLE)
.map(FailedSendAttempt::getSenderName)
.forEach(previouslyFailedSenders::add);

final SenderSelection selection = senderSelectionStrategy.chooseVerificationCodeSender(
messageTransport, phoneNumberFromSession, languageRanges, clientType, senderName,
previouslyFailedSenders);
Expand Down

0 comments on commit 86de827

Please sign in to comment.