Skip to content

Commit ad18fa2

Browse files
committed
Backed out changeset bc969033195f (bug 1872935) for causing failures in test_ping_submitted.py
1 parent 9170e90 commit ad18fa2

10 files changed

+32
-485
lines changed

browser/components/search/SearchSERPTelemetry.sys.mjs

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export const CATEGORIZATION_SETTINGS = {
5757
STARTING_RANK: 2,
5858
IDLE_TIMEOUT_SECONDS: 60 * 60,
5959
WAKE_TIMEOUT_MS: 60 * 60 * 1000,
60-
PING_SUBMISSION_THRESHOLD: 10,
6160
};
6261

6362
ChromeUtils.defineLazyGetter(lazy, "logConsole", () => {
@@ -86,22 +85,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
8685
if (newValue) {
8786
SearchSERPDomainToCategoriesMap.init();
8887
SearchSERPCategorizationEventScheduler.init();
89-
SERPCategorizationRecorder.init();
9088
} else {
9189
SearchSERPDomainToCategoriesMap.uninit();
9290
SearchSERPCategorizationEventScheduler.uninit();
93-
SERPCategorizationRecorder.uninit();
9491
}
9592
}
9693
);
9794

98-
XPCOMUtils.defineLazyPreferenceGetter(
99-
lazy,
100-
"activityLimit",
101-
"telemetry.fog.test.activity_limit",
102-
120
103-
);
104-
10595
export const SearchSERPTelemetryUtils = {
10696
ACTIONS: {
10797
CLICKED: "clicked",
@@ -2124,58 +2114,6 @@ class CategorizationEventScheduler {
21242114
* Handles reporting SERP categorization telemetry to Glean.
21252115
*/
21262116
class CategorizationRecorder {
2127-
#init = false;
2128-
2129-
// The number of SERP categorizations that have been recorded but not yet
2130-
// reported in a Glean ping.
2131-
#serpCategorizationsCount = 0;
2132-
2133-
// When the user started interacting with the SERP.
2134-
#userInteractionStartTime = null;
2135-
2136-
async init() {
2137-
if (this.#init) {
2138-
return;
2139-
}
2140-
2141-
Services.obs.addObserver(this, "user-interaction-active");
2142-
Services.obs.addObserver(this, "user-interaction-inactive");
2143-
this.#init = true;
2144-
this.submitPing("startup");
2145-
}
2146-
2147-
uninit() {
2148-
if (this.#init) {
2149-
Services.obs.removeObserver(this, "user-interaction-active");
2150-
Services.obs.removeObserver(this, "user-interaction-inactive");
2151-
this.#resetCategorizationRecorderData();
2152-
this.#init = false;
2153-
}
2154-
}
2155-
2156-
observe(subject, topic, data) {
2157-
switch (topic) {
2158-
case "user-interaction-active":
2159-
// If the user is already active, we don't want to overwrite the start
2160-
// time.
2161-
if (this.#userInteractionStartTime == null) {
2162-
this.#userInteractionStartTime = Date.now();
2163-
}
2164-
break;
2165-
case "user-interaction-inactive":
2166-
let currentTime = Date.now();
2167-
let activityLimitInMs = lazy.activityLimit * 1000;
2168-
if (
2169-
this.#userInteractionStartTime &&
2170-
currentTime - this.#userInteractionStartTime >= activityLimitInMs
2171-
) {
2172-
this.submitPing("inactivity");
2173-
}
2174-
this.#userInteractionStartTime = null;
2175-
break;
2176-
}
2177-
}
2178-
21792117
/**
21802118
* Helper function for recording the SERP categorization event.
21812119
*
@@ -2187,25 +2125,7 @@ class CategorizationRecorder {
21872125
"Reporting the following categorization result:",
21882126
resultToReport
21892127
);
2190-
Glean.serp.categorization.record(resultToReport);
2191-
2192-
this.#serpCategorizationsCount++;
2193-
if (
2194-
this.#serpCategorizationsCount >=
2195-
CATEGORIZATION_SETTINGS.PING_SUBMISSION_THRESHOLD
2196-
) {
2197-
this.submitPing("threshold_reached");
2198-
this.#serpCategorizationsCount = 0;
2199-
}
2200-
}
2201-
2202-
submitPing(reason) {
2203-
GleanPings.serpCategorization.submit(reason);
2204-
}
2205-
2206-
#resetCategorizationRecorderData() {
2207-
this.#serpCategorizationsCount = 0;
2208-
this.#userInteractionStartTime = null;
2128+
// TODO: Bug 1868476 - Report result to Glean.
22092129
}
22102130
}
22112131

browser/components/search/moz.build

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ BROWSER_CHROME_MANIFESTS += [
1818
"test/browser/telemetry/browser.toml",
1919
]
2020

21-
MARIONETTE_MANIFESTS += [
22-
"test/marionette/manifest.toml",
23-
"test/marionette/telemetry/manifest.toml",
24-
]
21+
MARIONETTE_MANIFESTS += ["test/marionette/manifest.toml"]
2522

2623
XPCSHELL_TESTS_MANIFESTS += ["test/unit/xpcshell.toml"]
2724

browser/components/search/test/browser/telemetry/browser.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ support-files = ["searchTelemetryDomainCategorizationReporting.html"]
5050
["browser_search_telemetry_domain_categorization_extraction.js"]
5151
support-files = ["searchTelemetryDomainExtraction.html"]
5252

53-
["browser_search_telemetry_domain_categorization_ping_submission.js"]
54-
support-files = [
55-
"searchTelemetryDomainCategorizationReporting.html",
56-
"searchTelemetryDomainExtraction.html",
57-
]
58-
5953
["browser_search_telemetry_domain_categorization_region.js"]
6054
support-files = ["searchTelemetryDomainCategorizationReporting.html"]
6155

browser/components/search/test/browser/telemetry/browser_search_glean_serp_event_telemetry_categorization_enabled_by_nimbus_variable.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ add_task(async function test_enable_experiment_when_pref_is_not_enabled() {
179179
await new Promise(resolve => setTimeout(resolve, 1500));
180180
BrowserTestUtils.removeTab(tab);
181181

182-
// We should not record telemetry if the experiment is un-enrolled.
183182
assertCategorizationValues([]);
184183

185184
// Clean up.

0 commit comments

Comments
 (0)