Closed Bug 1616752 Opened 4 years ago Closed 4 years ago

Add checks to the UrlbarResult constructor for each result type

Categories

(Firefox :: Address Bar, enhancement, P3)

enhancement
Points:
2

Tracking

()

RESOLVED FIXED
Firefox 76
Iteration:
76.2 - Mar 23 - Apr 5
Tracking Status
firefox76 --- fixed

People

(Reporter: adw, Assigned: adw)

References

Details

Attachments

(2 files)

It's probably a good idea to add checks to the UrlbarResult constructor to reject results that have missing or incorrect properties according to their types. For example, tip results need a type property. See discussion here: https://phabricator.services.mozilla.com/D62256#inline-379647

Another point that's related to this came up in the data review in bug 1608461 comment 42. For tips, we have the urlbar.tips keyed scalar telemetry. When a tip's main button and help button are picked, UrlbarInput automatically increments the keys <type>-picked and <type>-help, where <type> is the tip's payload.type [1]. So if we add a new tip type, we're automatically adding new keys to this scalar and therefore we need an expanded data collection review.

So two things, which we can probably do in this bug:

  • We should enforce that all TIP results have a payload.type (i.e., throw an error if one isn't given)
  • Wherever we end up enforcing that, we should also comment that adding new types automatically adds new keys to urlbar.tips and therefore requires expanded data collection review, as Tim requested in bug 1608461

[1] We should also probably automatically increment <type>-shown but we don't currently. The search tips and interventions providers manually do that. I'll file a bug.

I filed bug 1617318.

See Also: → 1617318
Assignee: nobody → adw
Status: NEW → ASSIGNED
Iteration: --- → 75.2 - Feb 24 - Mar 8
Iteration: 75.2 - Feb 24 - Mar 8 → 76.1 - Mar 9 - Mar 22
Attachment #9129053 - Attachment description: Bug 1616752 - Add payload schemas for each result type and validate payloads against them. → Bug 1616752 - Part 2: Add payload schemas for each result type and validate payloads against them.
Iteration: 76.1 - Mar 9 - Mar 22 → 76.2 - Mar 23 - Apr 5
Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/41590d1f096e
Part 1: Improve JsonSchemaValidator. r=mak,mythmon,mkaply
https://hg.mozilla.org/integration/autoland/rev/4f7300ad6e99
Part 2: Add payload schemas for each result type and validate payloads against them. r=mak
Blocks: 1625628
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 76
Depends on: 1626487
Flags: qe-verify-
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: