Closed Bug 1914542 Opened 1 year ago Closed 1 year ago

Replace UrlbarResult.exposureResultType and exposureResultHidden with a single simple value

Categories

(Firefox :: Address Bar, task, P1)

task

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: adw, Assigned: adw)

References

Details

Attachments

(1 file)

As part of bug 1914535, I'd like to replace UrlbarResult.exposureResultType and exposureResultHidden with a single simple value:

  // Per-result exposure telemetry.
  EXPOSURE_TELEMETRY: {
    // Exposure telemetry will not be recorded for the result.
    NONE: 0,
    // Exposure telemetry will be recorded for the result and the result will be
    // visible in the view as usual.
    SHOWN: 1,
    // Exposure telemetry will be recorded for the result but the result will
    // not be present in the view.
    HIDDEN: 2,
  },

This would solve a couple drawbacks with the two current properties:

  • exposureResultHidden doesn't matter when exposureResultType isn't defined, which is a little inelegant.
  • If exposure telemetry should be recorded for a certain result regardless of the exposureResults Nimbus variable/pref, right now we have to look up its telemetry type (e.g., UrlbarUtils.searchEngagementTelemetryType()) so we can set result.exposureResultType. That can be tricky to do for Suggest results because for them the telemetry type isn't available until the very end of the result creation process, so specific suggestion types can't set it immediately when they originate the result.

This replaces UrlbarResult.exposureResultType and exposureResultHidden with
a single simple value called exposureTelemetry. Please see the bug for the
rationale.

Other changes:

  • For convenience, make UrlbarPrefs.get("exposureResults") return a Set so
    consumers don't have to parse the string value.
  • Simplify handling of result properties in check_results() (xpcshell tests)
  • Add more tasks/checks to test_exposure.js

Depends on D219939

Pushed by dwillcoxon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8a2603cc59d2 Replace UrlbarResult.exposureResultType and exposureResultHidden with a single simple value. r=mak
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: