0

update_client: Persist IID through first active.

Previously, the IID would always be cleared on
the first update check, which is usually the
update-check-to-install. To avoid continuously
retransmitting a unique identifier for inactive
clients, the install ID is not sent for
non-active updatechecks, nor for non-install
pings.

Also, update the install ID on an overinstall.
This helps terminate the install funnel
telemetry for installers used in an overinstall
context.

Bug: 343239826
Change-Id: Ifb216019179fc307e2ac13e2a7abc4005f62dccd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6249219
Auto-Submit: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Commit-Queue: Joshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1418371}
This commit is contained in:
Joshua Pawlicki
2025-02-10 16:42:42 -08:00
committed by Chromium LUCI CQ
parent 31a42f494d
commit b14ca5315c
6 changed files with 42 additions and 9 deletions

@ -1153,10 +1153,11 @@ void UpdateServiceImplImpl::InstallImpl(
// registration is removed later if the app install encounters an error.
config_->GetUpdaterPersistedData()->RegisterApp(registration);
} else {
// Update ap.
// Update ap and iid.
RegistrationRequest request;
request.app_id = registration.app_id;
request.ap = registration.ap;
request.install_id = registration.install_id;
config_->GetUpdaterPersistedData()->RegisterApp(request);
}

@ -251,8 +251,8 @@ void PersistedDataImpl::SetDateLastDataHelper(
}
if (active_ids.find(id) != active_ids.end()) {
app_key->Set("dla", datenum);
app_key->Remove("iid");
}
app_key->Remove("iid");
}
std::move(callback).Run();
}

@ -40,7 +40,7 @@ TEST(PersistedDataTest, Simple) {
items.push_back("someappid");
items.push_back("someappid.withdot");
test::SetDateLastData(metadata.get(), items, 3383);
EXPECT_EQ("", metadata->GetInstallId("someappid"));
EXPECT_EQ("installation 1", metadata->GetInstallId("someappid"));
EXPECT_EQ(3383, metadata->GetDateLastRollCall("someappid"));
EXPECT_EQ(3383, metadata->GetDateLastRollCall("someappid.withdot"));
EXPECT_EQ(3383, metadata->GetInstallDate("someappid"));
@ -289,9 +289,12 @@ TEST(PersistedDataTest, ActivityData) {
EXPECT_EQ(3, metadata->GetDaysSinceLastRollCall("id2"));
EXPECT_EQ(4, metadata->GetDaysSinceLastRollCall("id3"));
metadata->SetInstallId("id2", "iid2");
test::SetDateLastData(metadata.get(), items, 5678);
EXPECT_EQ("iid2", metadata->GetInstallId("id2"));
activity_service->SetActiveBit("id2", true);
test::SetDateLastData(metadata.get(), items, 6789);
EXPECT_EQ("", metadata->GetInstallId("id2"));
EXPECT_EQ(false, test::GetActiveBit(metadata.get(), "id1"));
EXPECT_EQ(false, test::GetActiveBit(metadata.get(), "id2"));
EXPECT_EQ(false, test::GetActiveBit(metadata.get(), "id3"));
@ -310,6 +313,7 @@ TEST(PersistedDataTest, ActivityData) {
EXPECT_EQ(1234, metadata->GetInstallDate("id1"));
EXPECT_EQ(1234, metadata->GetInstallDate("id2"));
EXPECT_EQ(1234, metadata->GetInstallDate("id3"));
test::SetDateLastData(metadata.get(), items, 6790);
}
TEST(PersistedDataTest, LastUpdateCheckError) {

@ -58,14 +58,24 @@ void PingManager::SendPing(const std::string& session_id,
return;
}
// Install IDs are only sent on requests carrying an install event (2).
bool send_install_id = false;
for (const auto& event : events) {
if (event.FindInt("eventtype") == 2) {
send_install_id = true;
break;
}
}
const PersistedData& metadata = *config_->GetPersistedData();
std::vector<protocol_request::App> apps;
apps.push_back(MakeProtocolApp(
component.app_id, component.version, component.ap, component.brand,
metadata.GetInstallId(component.app_id), config_->GetLang(),
metadata.GetInstallDate(component.app_id), component.install_source,
component.install_location, component.fingerprint,
component.installer_attributes, metadata.GetCohort(component.app_id),
send_install_id ? metadata.GetInstallId(component.app_id) : "",
config_->GetLang(), metadata.GetInstallDate(component.app_id),
component.install_source, component.install_location,
component.fingerprint, component.installer_attributes,
metadata.GetCohort(component.app_id),
metadata.GetCohortHint(component.app_id),
metadata.GetCohortName(component.app_id), component.channel,
component.disabled_reasons, std::nullopt /* update check */,

@ -199,8 +199,10 @@ void UpdateCheckerImpl::CheckForUpdatesHelper(
apps.push_back(MakeProtocolApp(
app_id, crx_component->version, crx_component->ap, crx_component->brand,
metadata->GetInstallId(app_id), config_->GetLang(),
metadata->GetInstallDate(app_id), install_source,
active_ids.find(app_id) != active_ids.end()
? metadata->GetInstallId(app_id)
: "",
config_->GetLang(), metadata->GetInstallDate(app_id), install_source,
crx_component->install_location, crx_component->fingerprint,
crx_component->installer_attributes, metadata->GetCohort(app_id),
metadata->GetCohortHint(app_id), metadata->GetCohortName(app_id),

@ -55,6 +55,22 @@ detect and properly represent any overinstallations of an application, which are
done by users or third-party software on macOS (and don't otherwise interact
with the updater).
##### Install ID
The tag may carry a unique identifier called an "install ID" or "iid". The
install ID is transmitted back to the server as part of the install event
associated with running the installer, and as part of the first update check
for the app that reports activity. It is then deleted from the client. It is not
sent as part of update event reports, nor as part of non-active update checks,
nor as part of active update checks after the first.
If a user runs an installer when the software is already installed, the install
ID for the software will be updated to match, and the new value will be
transmitted during the install event and the next active update check.
The install ID is meant to enable the app distributor to correlate each
installer's download with the outcome of running that particular installer, and
whether or not the installed software is eventually actively used at least once.
#### Elevation (Windows)
The metainstaller parses its tag and re-launches itself at high integrity if
it is being run at medium integrity with UAC on and installing an application