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

Fixes ad conversions fail after a creative has expired #5834

Open
wants to merge 1 commit into
base: master
from

Conversation

@tmancey
Copy link
Collaborator

tmancey commented Jun 13, 2020

Resolves brave/brave-browser#10240

Submitter Checklist:

Test Plan:

  • Confim ad conversions work as expected after the creative has been removed from the catalog, i.e. expired
  • Confirm ad conversions are removed from the Default/ads_service/bundfle_state sqlite database when the expiry date has elapsed (see expiry_timestamp column)

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.
@tmancey tmancey self-assigned this Jun 13, 2020
@tmancey tmancey changed the title Fixes ad conversions are lost after a creative expires Fixes ad conversions fail after a creative has expired Jun 13, 2020
@tmancey tmancey force-pushed the issues/10240 branch 2 times, most recently from e650eeb to 0613c7a Jun 13, 2020
base::Time end_at_timestamp;
if (!base::Time::FromUTCString(campaign_info.end_at.c_str(),
&end_at_timestamp)) {
BLOG(1, "FOOBAR.2: " << campaign_info.end_at);

This comment has been minimized.

Copy link
@moritzhaller

moritzhaller Jun 13, 2020

Collaborator

for debugging?

This comment has been minimized.

Copy link
@tmancey

tmancey Jun 13, 2020

Author Collaborator

Fixed :-)

"expiry_timestamp TIMESTAMP, "
"UNIQUE(creative_set_id, type, url_pattern, "
"observation_window), "
"PRIMARY KEY(creative_set_id, type, url_pattern, "

This comment has been minimized.

Copy link
@moritzhaller

moritzhaller Jun 13, 2020

Collaborator

should expiry_timestamp be part of the PK to allow for a new conversion with an updated expiry date to be saved in the case that a campaign date updated in flight?

This comment has been minimized.

Copy link
@tmancey

tmancey Jun 13, 2020

Author Collaborator

If the observation_window or the expiry_timestamp change we want to update the current entry. And only insert entries if the creative_set_id, type and url_pattern are unique

@tmancey tmancey force-pushed the issues/10240 branch from 0613c7a to 4ccf0cf Jun 13, 2020
@tmancey tmancey requested a review from moritzhaller Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.