Targeting version check uses whichever version was cached first: `TargetingContextFields.for_application` ignores version
Maintainers usually reply within 1 day
@user-Param is already working on this.
Since Nov 1, 2026.
- #18035 by @user-Param — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in experimenter/targeting/targeting_context_parser.py and inspect TargetingContextFields.for_application and its per-application cache; then trace how _validate_targeting_configs checks version ranges. Reproduce with the described Fx158–160 targeting configuration and verify the result is independent of which version is loaded first, including a warning for unsupported profileLastUse in older versions.
Written by the indexing model from the issue text.
Description
Summary
NimbusReviewSerializer._validate_targeting_configs is supposed to flag targeting attributes that aren't available in some of the Firefox versions an experiment targets ("In versions […]: Targeting field X is not supported"). In practice it never flags older versions.
Steps to reproduce
- Add a Desktop advanced-targeting config that uses an attribute only recorded from Fx160+, e.g.:
targeting=(
f"{NO_ENTERPRISE.targeting} && profileLastUse > 0 && "
"(currentDate|date - profileLastUse|date) / 86400000 >= 28"
)
- Create a Desktop experiment with min version 158, no max version, and that targeting. Leave "Warn only on feature schema validation failure" unchecked.
- Open the experiment's Summary page. You should be able to launch with no warnings.
- Change the max version to 160 and navigate to the experiment's summary page again. There should be no warnings.
- Close the old local build and
make upa new build. - Repeat step 3 but with max version 160. Leave "Warn only on feature schema validation failure" unchecked.
- There should be a warning now.
Expected
A review error, because profileLastUse isn't in features/manifests/firefox-desktop/v158.0.x/ or v159.0.x/TargetingContextRecorder.sys.mjs (it first appears in v160.0.0): In versions ['159.0.1', '159.0.0', '158.0.2', '158.0.1', '158.0.0']: Targeting field profileLastUse is not supported
Actual
The result depends on which version was loaded first since the server process started:
-
Start with Min 158, no max: no error or warning. Debug output from the version loop shows
profileLastUsereported as present for every version from v161.0.0 down to v158.0.0. Even after changing max version to 158, it still shows no error or warning. -
Start with min 158, max 158: it shows error with 158. After updating the max version to no version, it shows errors with all versions.
Likely Cause
I believe that TargetingContextFields.for_application(app, version) in experimenter/targeting/targeting_context_parser.py caches the parsed fields per application only (_desktop_targeting_fields) and returns them for any version.
Since nothing clears the cache at runtime, so the first version loaded in a server process is reused for every later check in that process. _validate_targeting_configs checks versions newest-first, so multi-version ranges usually compare every version against the newest version's fields I believe.
┆Issue is synchronized with this Jira Task
- Dominant language
- Python
- Stars
- 152
- Forks
- 231
- Avg merge
- 23h 54m
- Merged PRs (30d)
- 201
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mozilla/experimenter
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
mozilla/experimenter#18288 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla/experimenter#18281 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
mozilla/experimenter#18132 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
mozilla/experimenter#18079 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mozilla/experimenter#17523 ·
Maintainers usually reply within 1 day
All issues in mozilla/experimenter
Similar issues
-
eegprep-lean: set channel types from the Zarr group's channel_typePossibly taken @claude claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
sccn/eegprep#668 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
blacklanternsecurity/bbot#3679 ·
Maintainers usually reply within 2 days
-
Link Checker ReportOpenBot Type: Bug Type: Documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
speakeasy-api/speakeasy#2159 ·
Maintainers usually reply within 1 day