Skip to content

Conversation

@ohall-m
Copy link
Contributor

@ohall-m ohall-m commented Jan 12, 2026

This patch adds functionality to use the new PreviousGeckoPrefState.

It adds:

  • set_gecko_prefs_original_values for external handling of setting prefs back to original values
  • Mechanisms to return to a previous states when:
    • on_experiment_updated
      • Certain situations and as determined in will_pref_experiment_change
    • on_experiment_ended
    • on_opt_out

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

This patch adds functionality to use the new PreviousGeckoPrefState.

It adds:

* `set_gecko_prefs_original_values` for external handling of setting prefs back to original values
* Mechanisms to return to a previous states when:
  * `on_experiment_updated`
    * Certain situations and as determined in will_pref_experiment_change
  * `on_experiment_ended`
  * `on_opt_out`
@ohall-m
Copy link
Contributor Author

ohall-m commented Jan 12, 2026

Hey @freshstrangemusic and @jeddai, just leaving a message that part 2 to use the stored values is up because I can't set reviewers!

The observer part 3 will be in bug 2006095.

@ohall-m
Copy link
Contributor Author

ohall-m commented Jan 14, 2026

I didn't add anything in unenroll_for_gecko_pref because this is what the observer will call into in the event of an external gecko pref change and we do not want to revert the pref in that case. Mentioning it as a heads up because I think it might be a bit unexpected from certain standpoints - like it almost looks like a utility that handles all the pref stuff in one swoop. I keep revisiting it and am afraid it could be confusing down the road.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant