Closed Bug 2059550 Opened 3 months ago Closed 3 months ago

Sync and AIChatbot enterprise policies are broken due to invalid imports from Policies.sys.mjs

Categories

(Enterprise Products :: Firefox, defect)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jporter, Assigned: jporter)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 external files)

The Sync enterprise policy parses and appears active in about:policies, but is not properly applied. The AIChatbot policy fails to apply and provides an error. Both failures are caused by the same root cause of an invalid import of the policy helpers setAndLockPref, unsetAndUnlockPref, and PoliciesUtils. Bug 2048572 moved the helpers into toolkit to a new PoliciesHelpers.sys.mjs helper.

Additionally, the Sync policy was swallowing this error due to using async/await which is not supported by the policy engine. Swapping this for a .then() allows this error message to surface.

Error messages:

Error running onBeforeAddons callback for policy AIChatbot: SyntaxError: The requested module 'resource:///modules/policies/Policies.sys.mjs' doesn't provide an export named: 'unsetAndUnlockPref'
Error running onBeforeAddons callback for policy Sync: SyntaxError: The requested module 'resource:///modules/policies/Policies.sys.mjs' doesn't provide an export named: 'setAndLockPref'

Authored by https://github.com/jporter-dev
https://github.com/mozilla/enterprise-firefox/commit/4b93341f6344e66add0209e0a7430f8c1df43d42
[enterprise-main] Bug 2059550 - Fix broken imports in Sync and AIChatbot policies

Authored by https://github.com/jporter-dev
https://github.com/mozilla/enterprise-firefox/commit/8d4bfaefb3bda27e15ff453667c65a3bdfcaeaa8
[enterprise-main] Merge pull request #1212 from jporter-dev/enterprise-bug-2059550-fix-sync-and-aichatbot-policies

Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Flags: qe-verify+

Verified fixed on 155.0a1 (20260812080931) with macOS 26.4 and Win 11.
For sync, manual sync was enabled and all items synced. Added the policy after and checked that the policy settings (locked, 2 items disabled) have overridden the manual setup.
For the AI chat, after adding the policy I verified no errors were received in about:policies and checked that the sidebar AI window opens directly to a functional private AI, as set in the policy.
See the recording for more details.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: