tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 4a086c0d65e33f30b1e817f78e212bc2965cba29
parent 6cedbdbba038c732243e83e0f36fa184f3d06a5b
Author: Rolf Rando <rrando@mozilla.com>
Date:   Mon,  8 Dec 2025 21:03:20 +0000

Bug 2004783 - Fix normalization bug. Issue with local ranker state refreshing. r=mlplyler,home-newtab-reviewers,nbarrett

When a user is enrolled in an inferred experiment the local re-ranking was not enabled until browser restart.
This applies to turning on the user pref switch as well. The 'turn off' situation was working properly, because the interest vector was cleared anyway.

We also have an internal fix to the normalization code. The normalization feature is not turned on yet, but this change will allow normalization to apply to private interests only for the inferred interest vector.

Differential Revision: https://phabricator.services.mozilla.com/D275512

Diffstat:
Mbrowser/extensions/newtab/lib/DiscoveryStreamFeed.sys.mjs | 2++
Mbrowser/extensions/newtab/lib/InferredModel/FeatureModel.sys.mjs | 2+-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/browser/extensions/newtab/lib/DiscoveryStreamFeed.sys.mjs b/browser/extensions/newtab/lib/DiscoveryStreamFeed.sys.mjs @@ -2215,6 +2215,7 @@ export class DiscoveryStreamFeed { await this.resetContentCache(); // Reset in-memory caches. this._isContextualAds = undefined; + this._doLocalInferredRerank = undefined; this._spocsCacheUpdateTime = undefined; this._spocsOnDemand = undefined; } @@ -2494,6 +2495,7 @@ export class DiscoveryStreamFeed { case PREF_USER_INFERRED_PERSONALIZATION: this.configReset(); this._isContextualAds = undefined; + this._doLocalInferredRerank = undefined; await this.resetContentCache(); break; case PREF_CONTEXTUAL_ADS: diff --git a/browser/extensions/newtab/lib/InferredModel/FeatureModel.sys.mjs b/browser/extensions/newtab/lib/InferredModel/FeatureModel.sys.mjs @@ -514,8 +514,8 @@ export class FeatureModel { this.privateFeatures.includes(key) ) ); - this.applyPostProcessing({ ...originalInterestValues }); } + coarsePrivateValues = this.applyPostProcessing(coarsePrivateValues); this.applyThresholding(coarsePrivateValues, true); if (condensePrivateValues) {