Closed Bug 1621018 Opened 4 years ago Closed 4 years ago

Move v2 personalization into promise worker

Categories

(Firefox :: New Tab Page, enhancement, P2)

enhancement

Tracking

()

VERIFIED FIXED
Firefox 76
Tracking Status
firefox76 --- verified

People

(Reporter: thecount, Assigned: thecount)

References

Details

Attachments

(1 file, 1 obsolete file)

The current state of v2 personalization is still doing quite a bit of JavaScript on the main thread.

This feature is preffed off, and in order to pref it on, we need to move it off the main thread.

We do this by moving it into a promise worker.

https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/PromiseWorker.jsm

Assignee: nobody → sdowne
Priority: -- → P2
Attachment #9133216 - Attachment is obsolete: true

To test:

  1. Create a brand new profile
  2. Set browser.newtabpage.activity-stream.asrouter.devtoolsEnabled to true
  3. Open about:newtab#devtools-ds
  4. Ensure "show_spocs" is checked
  5. Scroll down a bit and click "Enable V2 Personalization"
  6. Scroll up and click "Trigger Idle Daily"
  7. You should now have all the attachments from remote settings downloaded.
  8. Scroll up and click "Expire Cache"
  9. Scroll up and click "Trigger System Tick"
  10. refresh the browser.
  11. Look for a spoc under "spoc data" and click "collapse/open" on any of those spocs.

Expected:
Look for score to be different from item_score this is the easiest way to verify atm.

Blocks: 1624481
Pushed by sdowne@getpocket.com:
https://hg.mozilla.org/integration/autoland/rev/ed840ec54b16
Move v2 personalization into promise worker. r=gvn,jonathankoren,mconley
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 76

I have verified this, using the above steps, on Firefox Nighlty 76.0a1 (Build ID 20200329214909) and obtained the following results:

  • clicking on the "Trigger Idle Daily" button => no changes, at least on the visual side; same for "Expire cache" and "Trigger System Tick";
  • refresh was made using both "F5" key and "Refresh Cache" from about:newtab#devtools-ds ;
  • only 1 row with data is displayed in the "Spoc data" section - clicking on the "collapse/open" button will show same results for "score" and "item_score";
    Is this the expected behavior, to have two different fields: score and item_score with same value or each field to have different values?
    Please let me know if I am missing something out. Thanks!

I've also set the bellow prefs:

Flags: needinfo?(sdowne)

The values in score and item_score should be different, and yes, you should see both.

I think the reason they are the same is because I suspect in step 10 you refreshed the cache, which would refresh the score too. I updated step 10 to be more clear, so it doesn't get confused with refresh cache.

Hope that helps!

Flags: needinfo?(sdowne)

Verified that this was implemented on Firefox Nightly 76.0a1 (Build ID 20200330220101) using Windows 10, Linux Ubuntu 18.04 and Mac 10.15.
The "score" and "item_score" fields are available and have different values.

Status: RESOLVED → VERIFIED
Depends on: 1633672
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: