Sooner or later we will want to run an experiment in specific countries, which will require some sort of solution to do that. Since bug 1109120, Firefox is now able to figure out that information. But it's not present in the FHR or Telemetry payloads available to the filter function. If we don't add it, we will end up working around it with less elegant solutions like having the experiment code itself do the checks, and then it will need to deactivate itself, and that will leave an inactive/finished experiment in the Add-ons Manager, etc.. If the information from bug 1109120 is not present, it could fall back to the locale code.
Is this available synchronously? Currently that function runs synchronously on the main thread, so async APIs would be a problem. Also, why isn't that code recorded in FHR/telemetry? We really ought to be validating that our client-side understanding of the code matches the current FHR server-side data.
_runFilterFunction is async, so it wouldn't be a problem. But in any case, the geoIP request caches the countryCode result in a pref, and I was thinking of just grabbing the pref value if available, or otherwise let it go/fallback to locale if not yet available. I don't know why that value is not recorded.. probably because no one asked for it to be recorded yet
Did this actually come up as a use-case or can we close this bug?
Hm I think at the time there was plans to release some experiments that needed that, but the requirements were changed so it wasn't actually necessary. I think this would be nice to have, but it has never came up as a use-case again. If you prefer to close the bug for now, feel free.
This is a frequently-requested experiment feature, now that Firefox knows its country code. It should be in the backlog of work.