Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds error logic for one-time tip #1488

Merged
merged 1 commit into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"description": "We show this string in the notification when you don't have enough funds for contribution"
},
"contributeNotificationTipError": {
"message": "There was a problem processing your tip, please try again.",
"message": "Unable to send your tip. Please try again later.",
"description": "We show this string in notification when tip fails"
},
"noActivity": {
Expand Down
9 changes: 9 additions & 0 deletions vendor/bat-native-ledger/src/bat_contribution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,15 @@ void BatContribution::AddRetry(
reconcile = ledger_->GetReconcileById(viewing_id);
}

// Don't retry one-time tip if in phase 1
if (GetRetryPhase(step) == 1 &&
reconcile.category_ == ledger::REWARDS_CATEGORY::DIRECT_DONATION) {
OnReconcileComplete(ledger::Result::TIP_ERROR,
viewing_id,
reconcile.category_);
return;
}

uint64_t start_timer_in = GetRetryTimer(step, viewing_id, reconcile);
bool success = ledger_->AddReconcileStep(viewing_id,
reconcile.retry_step_,
Expand Down