Page MenuHomePhabricator

Enable/disable experiment based on config on mediawiki
Closed, ResolvedPublic

Description

The dates and country (or countries) and language (or languages) for which the experiment should run will be stored in json format on mediawiki.

The app should query the config and turn the experiment on or off accordingly.

The current country of the app can be obtained by reading the Geojson string in the 'set-cookie' header of the API call to get the experiment config. See this commit

The country code should also be added to the URL used to get the experiment data from the API. (Done in another PR)

The config will store in user local storage and expire the next day; in other words, the app will request the new config when it detects expiration.

Config page: https://www.mediawiki.org/wiki/Wikipedia_for_KaiOS/engagement1

Event Timeline

SBisson updated the task description. (Show Details)

The current country of the app can be obtained by reading the Geojson string in the 'set-cookie' header of the API call to get the experiment config. See this commit

getting the set-cookie value from response header is not possible, https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders#return_value, and it just returns null in most cases, seems like because of Cross-domain cookies

Will continue check for more resource to see the possibility.

In the commit referenced in the task description, I was able to print it to the console so it seems possible. Keep in mind that request made from the device are not CORS.

You are right, after trying on device, we are able to get the info, thanks!

hueitan updated the task description. (Show Details)