Fixes Bug 1476045 - SPOCs stop showing after seeing 100 impressions of the same campaign
This commit is contained in:
Родитель
bc61ceb994
Коммит
7de1abf072
|
@ -25,7 +25,7 @@ const DEFAULT_RECS_EXPIRE_TIME = 60 * 60 * 1000; // 1 hour
|
|||
const SECTION_ID = "topstories";
|
||||
const SPOC_IMPRESSION_TRACKING_PREF = "feeds.section.topstories.spoc.impressions";
|
||||
const REC_IMPRESSION_TRACKING_PREF = "feeds.section.topstories.rec.impressions";
|
||||
const MAX_LIFETIME_CAP = 100; // Guard against misconfiguration on the server
|
||||
const MAX_LIFETIME_CAP = 500; // Guard against misconfiguration on the server
|
||||
|
||||
this.TopStoriesFeed = class TopStoriesFeed {
|
||||
constructor() {
|
||||
|
|
|
@ -765,7 +765,7 @@ describe("Top Stories Feed", () => {
|
|||
"settings": {"spocsPerNewTabs": 1},
|
||||
"recommendations": [{"guid": "rec1"}, {"guid": "rec2"}, {"guid": "rec3"}],
|
||||
"spocs": [
|
||||
{"id": "spoc1", "campaign_id": 1, "caps": {"lifetime": 101}}
|
||||
{"id": "spoc1", "campaign_id": 1, "caps": {"lifetime": 501}}
|
||||
]
|
||||
};
|
||||
|
||||
|
@ -776,7 +776,7 @@ describe("Top Stories Feed", () => {
|
|||
fetchStub.resolves({ok: true, status: 200, json: () => Promise.resolve(response)});
|
||||
await instance.fetchStories();
|
||||
|
||||
instance._prefs.get = pref => JSON.stringify({1: [...Array(100).keys()]});
|
||||
instance._prefs.get = pref => JSON.stringify({1: [...Array(500).keys()]});
|
||||
instance.onAction({type: at.NEW_TAB_REHYDRATED, meta: {fromTarget: {}}});
|
||||
assert.notCalled(instance.store.dispatch);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче