Closed Bug 1685130 Opened 3 years ago Closed 3 years ago

Provide a pref for spoc endpoint query string

Categories

(Firefox :: New Tab Page, enhancement)

enhancement

Tracking

()

VERIFIED FIXED
86 Branch
Tracking Status
firefox86 --- verified

People

(Reporter: thecount, Assigned: thecount)

Details

Attachments

(1 file)

Right now we have a pref for experiments and QA to provide a specialized spoc endpoint. browser.newtabpage.activity-stream.discoverystream.spocs-endpoint

This can be troublesome for QA/testing outside of the US. The way spoc endpoints work is it checks your region, so if you're not in the US you don't get results.

We've solved this up to this point with either adding a query to the url in that pref, or a VPN.

For QAing something, a VPN is fine, but in a lot of cases, we also just want to quickly add a query.

The problem with adding a query is you're providing a completely new pref value, and testing that the code works with the new pref value. It's not really testing the original pref value. So if the original pref value has a typo but your QA modified value does not, you might miss an issue.

I think we can fix this by adding a pref for query itself, that the code can use to add to the endpoint pref. This way, if the original pref has an issue, the code is likely to fail doing the fetch, or fail applying the query, thus we'll notice the issue in QA.

Assignee: nobody → sdowne
Status: NEW → ASSIGNED

To test:

  1. Turn on browser.newtabpage.activity-stream.asrouter.devtoolsEnabled
  2. Set browser.newtabpage.activity-stream.discoverystream.spocs-endpoint to something like "https://spocs.getpocket.com/spocs?site=whatever"
  3. Set browser.newtabpage.activity-stream.discoverystream.spocs-endpoint-query to something like "?thing=whatever&double=two"
  4. Go to about:newtab#devtools-ds
  5. Scroll down to and look at spocs_endpoint

Expected: the spocs endpoint should be "https://spocs.getpocket.com/spocs?site=whatever&thing=whatever&double=two"

This should be pretty robust, and "do the right thing" for cases like this "?thing=whatever&double=two", "&thing=whatever&double=two", and "thing=whatever&double=two". Should also be able to handle an intial endpoint both with and without an existing query.

Pushed by sdowne@getpocket.com:
https://hg.mozilla.org/integration/autoland/rev/a41174d41a49
Provide a pref for newtab spoc endpoint query string. r=gvn
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

I have verified that the "spocs_endpoint" is displayed with the "https://spocs.getpocket.com/spocs?site=whatever&thing=whatever&double=two" value in the "about:newtab#devtools-ds" page by following the steps provided in comment 2 using Firefox Nightly 86.0a1 (20210107040715) on Windows 10 x64, macOS 10.15, and Ubuntu Linux 20.04.

I have also verified this enhancement with the values of an older experiment and can confirm that it works.

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

Attachment

General

Created:
Updated:
Size: