Skip to content

Bug 2038991 - Update Cache when calling register_previous_gecko_pref_states#7369

Open
ohall-m wants to merge 1 commit into
mozilla:mainfrom
ohall-m:2038991
Open

Bug 2038991 - Update Cache when calling register_previous_gecko_pref_states#7369
ohall-m wants to merge 1 commit into
mozilla:mainfrom
ohall-m:2038991

Conversation

@ohall-m
Copy link
Copy Markdown
Contributor

@ohall-m ohall-m commented May 13, 2026

Bug 2021137 removed end_initialize and set writer.commit() to prevent a loop. However, this change had a side-effect of a stale cache.

This patch fixes it by:

  • Adding a param of update_gecko_prefs to commit_and_update
  • Having register_previous_gecko_pref_states call commit_and_update with update_gecko_prefs=false
  • Updating map_gecko_prefs_to_enrollment_slugs_and_update_store to take a param of update_gecko_prefs, when false, it will not set information with Gecko

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.

…states

Bug 2021137 removed end_initialize and set `writer.commit()` to prevent
a loop. However, this change had a side-effect of a stale cache.

This patch fixes it by:
* Adding a param of `update_gecko_prefs` to `commit_and_update`
* Having `register_previous_gecko_pref_states` call  `commit_and_update`
with `update_gecko_prefs=false`
* Updating `map_gecko_prefs_to_enrollment_slugs_and_update_store` to take a
param of `update_gecko_prefs`, when false, it will not set information with
Gecko
@ohall-m ohall-m requested a review from freshstrangemusic May 13, 2026 21:45
@ohall-m ohall-m self-assigned this May 13, 2026
@ohall-m ohall-m added the rust Pull requests that update Rust code label May 13, 2026
Copy link
Copy Markdown
Contributor Author

@ohall-m ohall-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually tested by going through setting each of the Nimbus-QA prefs using CLIs, ran a few unenrollment scenarios (pref changing, opt-out), and the dual Enrollment/Rollout test.

}

writer.commit()?;
let coenrolling_ids = self
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied this from end_initialize.

I interpreted that commit_and_update was handling the writer.commit()?;.

Diverged a little bit from what we talked about since commit_and_update seemed like it could be used directly, LMKWYT!

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

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant