Skip to content

Commit

Permalink
Refactor - auto update credential provider script (#23469)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] authored Nov 29, 2024
1 parent eb615fa commit 38f7c92
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 54 deletions.
48 changes: 0 additions & 48 deletions firefox-ios/Client/Assets/CC_Script/AutofillTelemetry.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,6 @@ class AutofillTelemetryBase {
throw new Error("Not implemented.");
}

recordDetectedSectionCount() {
throw new Error("Not implemented.");
}

recordSubmittedSectionCount(_count) {
throw new Error("Not implemented.");
}

recordNumberOfUse(records) {
let histogram = Services.telemetry.getKeyedHistogramById(
this.HISTOGRAM_PROFILE_NUM_USES
Expand Down Expand Up @@ -369,18 +361,6 @@ export class AddressTelemetry extends AutofillTelemetryBase {
recordAutofillProfileCount(count) {
Glean.formautofillAddresses.autofillProfilesCount.set(count);
}

recordDetectedSectionCount() {
Glean.formautofillAddresses.detectedSectionsCount.add(1);
}

recordSubmittedSectionCount(count) {
if (!count) {
return;
}

Glean.formautofillAddresses.submittedSectionsCount.add(count);
}
}

class CreditCardTelemetry extends AutofillTelemetryBase {
Expand Down Expand Up @@ -436,18 +416,6 @@ class CreditCardTelemetry extends AutofillTelemetryBase {
recordAutofillProfileCount(count) {
Glean.formautofillCreditcards.autofillProfilesCount.set(count);
}

recordDetectedSectionCount() {
Glean.formautofillCreditCards.detectedSectionsCount.add(1);
}

recordSubmittedSectionCount(count) {
if (!count) {
return;
}

Glean.formautofillCreditCards.submittedSectionsCount.add(count);
}
}

export class AutofillTelemetry {
Expand Down Expand Up @@ -512,22 +480,6 @@ export class AutofillTelemetry {
telemetry.recordFormInteractionEvent(method, flowId, fieldDetails, data);
}

/**
* Utility functions for submitted section count scalar (defined in Scalars.yaml)
*
* Category: formautofill.creditCards or formautofill.addresses
* Scalar name: submitted_sections_count
*/
static recordDetectedSectionCount(fieldDetails) {
const telemetry = this.#getTelemetryByFieldDetail(fieldDetails[0]);
telemetry.recordDetectedSectionCount();
}

static recordSubmittedSectionCount(fieldDetails, count) {
const telemetry = this.#getTelemetryByFieldDetail(fieldDetails[0]);
telemetry.recordSubmittedSectionCount(count);
}

static recordManageEvent(type, method) {
const telemetry = this.#getTelemetryByType(type);
telemetry.recordManageEvent(method);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ export class FormAutofillSection {
return;
}

lazy.AutofillTelemetry.recordDetectedSectionCount(this.fieldDetails);
lazy.AutofillTelemetry.recordFormInteractionEvent(
"detected",
this.flowId,
Expand Down Expand Up @@ -388,7 +387,6 @@ export class FormAutofillSection {
onSubmitted(formFilledData) {
this.submitted = true;

lazy.AutofillTelemetry.recordSubmittedSectionCount(this.fieldDetails, 1);
lazy.AutofillTelemetry.recordFormInteractionEvent(
"submitted",
this.flowId,
Expand Down
8 changes: 4 additions & 4 deletions firefox-ios/Client/Assets/CC_Script/Helpers.ios.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,9 @@ window.Localization = function () {
// dispatches telemetry messages to the iOS, we need to modify typedefs in swift. For now, we map the telemetry events
// to the expected shape. FXCM-935 will tackle cleaning this up.
window.Glean = {
// TODO(FXCM-1453): While moving away from legacy scalars to glean ones, the automated script generated
// an additional category `formautofill.credit_cards`. This resulted into two different methods in our code
// with different casing for the c in Credit(c|C)ards. This is a temp fix until FXCM-1453 happens.
// While moving away from Legacy Telemetry to Glean, the automated script generated the additional categories
// `creditcard` and `address`. After bug 1933961 all probes will have moved to category formautofillCreditcards and formautofillAddresses.
formautofillCreditcards: undefinedProxy(),
formautofillCreditCards: undefinedProxy(),
formautofill: undefinedProxy(),
creditcard: undefinedProxy(),
_mapGleanToLegacy: (eventName, { value, ...extra }) => {
Expand Down Expand Up @@ -237,6 +235,8 @@ window.Glean = {
},
}
),
// Keeping unused category formautofillAddresses here, because Bug 1933961
// will move probes from the glean category address to formautofillAddresses
formautofillAddresses: undefinedProxy(),
};

Expand Down

0 comments on commit 38f7c92

Please sign in to comment.