Skip to content

[ads] Preserve search ad info bar preference when clearing ads data #29028

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

Merged
merged 1 commit into from
May 13, 2025

Conversation

aseren
Copy link
Collaborator

@aseren aseren commented May 12, 2025

Resolves brave/brave-browser#45213

Test plan

Test case 1

  • Fresh install
  • Open search.brave.software in a new tab
  • Make Giraffe search query
  • Click the search result ad
    EXPECTATION: Search result ad infobar was shown
  • Open search.brave.software in a new tab
  • Make Giraffe search query
  • Click the search result ad
    EXPECTATION: Search result ad infobar was NOT shown

Test case 2

  • Install Brave version 1.79.x (an old version)
  • Open search.brave.software in a new tab
  • Make Giraffe search query
  • Click the search result ad
    EXPECTATION: Search result ad infobar was shown
  • Update the browser to version 1.80.x
  • Open search.brave.software in a new tab
  • Make Giraffe search query
  • Click the search result ad
    EXPECTATION: Search result ad infobar was NOT shown

Test case 3

  • Install Brave version 1.79.x (an old version)
  • Update the browser to version 1.80.x
  • Open search.brave.software in a new tab
  • Make Giraffe search query
  • Click the search result ad
    EXPECTATION: Search result ad infobar was shown

@aseren aseren requested a review from a team as a code owner May 12, 2025 20:36
Comment on lines 40 to 55
// Added 12/2024.
registry->RegisterBooleanPref(kObsoleteShouldShowSearchResultAdClickedInfoBar,
false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wrong date.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@aseren aseren requested a review from tmancey May 12, 2025 20:50
@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

Discovered possible removal of preference registrations.

Please make sure to properly deprecate preferences by clearing their
value for a couple of milestones before finally removing the code.
Otherwise data may stay in the preferences files forever. See
Migrate*Prefs() in chrome/browser/prefs/browser_prefs.cc and
chrome/browser/prefs/README.md for examples.
This may be a false positive warning (e.g. if you move preference
registrations to a different place).

Items:

components/brave_ads/core/internal/prefs/obsolete_pref_util.cc: -  registry->RegisterBooleanPref(kHasMigratedConversionState, false);
components/brave_ads/core/internal/prefs/obsolete_pref_util.cc: -  registry->RegisterBooleanPref(kHasMigratedNotificationState, false);
components/brave_ads/core/internal/prefs/obsolete_pref_util.cc: -  registry->RegisterBooleanPref(kHasMigratedRewardsState, false);
components/brave_ads/core/internal/prefs/obsolete_pref_util.cc: -  registry->RegisterBooleanPref(kShouldMigrateVerifiedRewardsUser, false);

@aseren aseren enabled auto-merge (squash) May 12, 2025 21:11
@aseren aseren merged commit 7a2beb9 into master May 13, 2025
20 checks passed
@aseren aseren deleted the issues/45213 branch May 13, 2025 00:37
@github-actions github-actions bot added this to the 1.80.x - Nightly milestone May 13, 2025
@brave-builds
Copy link
Collaborator

Released in v1.80.59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ads] Preserve search ad info bar preference when clearing ads data
3 participants