Skip to content
New issue

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

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

Already on GitHub? # to your account

Fixes old promotions not being displayed in the total #5569

Merged
merged 1 commit into from
May 16, 2020
Merged
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 @@ -441,8 +441,8 @@ void DatabaseUnblindedToken::GetRecordsByTriggerIds(
const std::string query = base::StringPrintf(
"SELECT ut.token_id, ut.token_value, ut.public_key, ut.value, "
"ut.creds_id, ut.expires_at FROM %s as ut "
"INNER JOIN creds_batch as cb ON cb.creds_id = ut.creds_id "
"WHERE cb.trigger_id IN (%s)",
"LEFT JOIN creds_batch as cb ON cb.creds_id = ut.creds_id "
"WHERE cb.trigger_id IN (%s) OR ut.creds_id IS NULL",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is ok as only old promotions will have null

kTableName,
GenerateStringInCase(trigger_ids).c_str());

Expand Down Expand Up @@ -523,10 +523,10 @@ void DatabaseUnblindedToken::GetSpendableRecordListByBatchTypes(
const std::string query = base::StringPrintf(
"SELECT ut.token_id, ut.token_value, ut.public_key, ut.value, "
"ut.creds_id, ut.expires_at FROM %s as ut "
"INNER JOIN creds_batch as cb ON cb.creds_id = ut.creds_id "
"LEFT JOIN creds_batch as cb ON cb.creds_id = ut.creds_id "
"WHERE ut.redeemed_at = 0 AND "
"(ut.expires_at > strftime('%%s','now') OR ut.expires_at = 0) AND "
"cb.trigger_type IN (%s)",
"(cb.trigger_type IN (%s) OR ut.creds_id IS NULL)",
kTableName,
base::JoinString(in_case, ",").c_str());

Expand Down