Skip to content

Commit

Permalink
Issue with Ads Payments (August 5)
Browse files Browse the repository at this point in the history
Fixes brave/brave-browser#5548

* Fix race condition where same token was reused due to network latency etc.
* Fix issue where only 1 failed confirmation was retried per session
* Migrate failed confirmation tokens which return HTTP_NOT_FOUND due to race condition
* Fix HTTP_BAD_REQUEST errors when retrying failed confirmations if the confirmation was already created
  • Loading branch information
tmancey authored and samartnik committed Aug 28, 2019
1 parent 2602d0e commit 9058069
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "base/base64.h"
#include "brave_base/random.h"
#include "net/http/http_status_code.h"
#include "base/base64.h"

using std::placeholders::_1;
using std::placeholders::_2;
Expand Down Expand Up @@ -179,7 +180,7 @@ void RedeemToken::OnCreateConfirmation(

if (response_status_code != net::HTTP_CREATED) {
BLOG(ERROR) << "Failed to create confirmation";
OnRedeem(FAILED, confirmation);
OnRedeem(FAILED, confirmation, false);
return;
}

Expand Down

0 comments on commit 9058069

Please # to comment.