Closed Bug 1915291 Opened 2 months ago Closed 2 months ago

The ingest logic for detecting newly enabled Suggest suggestions is broken

Categories

(Firefox :: Address Bar, defect, P1)

defect

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: adw, Assigned: adw)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In bug 1907696 I added some logic to BaseFeature that tries to ingest only newly enabled suggestion types when update() is called. It doesn't work right because by the time it gets the old enabled suggestion types, prefs/variables have already changed, so isRustSuggestionTypeEnabled() reflects the new enabled status, not the old. So later when it tries to ingest only newly enabled suggestion types, it won't because it will think those types were already enabled.

This isn't a huge problem because it only affects features that manage more than one suggestion type, and only when one type was already enabled, i.e., only when the feature itself was already enabled. AdmWikipedia is the only feature that manages multiple types. So to trigger this, the user would have to have sponsored enabled, nonsponsored disabled, and then turn on nonsponsored (or vice versa). And even then, ingest on startup isn't affected, so the worst case is that they might end up with slightly outdated AMP or Wikipedia suggestions.

This keeps track of the enabled suggestion types that have been ingested while
the app is running. I call those types "fresh". In the code, they're stored in
the #ingestedSuggestionTypes set. Types that have not been ingested and types
that are disabled are called "stale". When a feature is updated, we update the
staleness bookkeeping in #ingestedSuggestionTypes and ingest only enabled
stale types.

This is similar to how each feature has an #isEnabled property. It's our
cached value of the last-known state that we can compare to the current state.

Depends on D219943

Pushed by dwillcoxon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a61953378828 Keep track of stale Suggest suggestion types and ingest only stale types when their feature is updated. r=daisuke
Status: ASSIGNED → RESOLVED
Closed: 2 months 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: