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

Only update P3A activation date if bucket value is greater than or equal to 1 #27756

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion components/p3a/message_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void MessageManager::UpdateMetricValue(
}
const auto* metric_config = GetMetricConfig(histogram_name);
if (metric_config && *metric_config &&
(*metric_config)->record_activation_date) {
(*metric_config)->record_activation_date && bucket >= 1) {
// Record activation date for metric, for retention measurement purposes
ScopedDictPrefUpdate update(&*local_state_, kActivationDatesDictPref);
if (!update->contains(histogram_name)) {
Expand Down
4 changes: 4 additions & 0 deletions components/p3a/message_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,10 @@ TEST_F(P3AMessageManagerTest, ActivationDate) {

auto ref_time = base::Time::Now();

message_manager_->UpdateMetricValue(activation_metric, 0);
activation_date = meta.GetActivationDate(activation_metric);
ASSERT_FALSE(activation_date);

message_manager_->UpdateMetricValue(activation_metric, 1);

activation_date = meta.GetActivationDate(activation_metric);
Expand Down
Loading