Open
Bug 2063350
Opened 20 days ago
Updated 20 days ago
Add an onUpdate callback to the live policy engine
Categories
(Enterprise Products :: Firefox, enhancement)
Enterprise Products
Firefox
Tracking
(Not tracked)
NEW
People
(Reporter: janika, Unassigned)
References
(Blocks 1 open bug)
Details
The live policy engine applies a changed policy by running onRemovewith the old params and then re-applying with the new ones (see _schedulePolicyUpdates). Callbacks are batched by timing across all policies — all onRemove first, then all "re-apply callbacks" — and each is invoked fire-and-forget (_runPoliciesCallbacks does not await them).
This "tear down, then rebuild" model keeps updates from leaving stale state, but the non-awaited invocation has two ordering consequences:
- Anything both the old and new params impose is released by
onRemoveand re-imposed on re-apply. Usually that gap is sub-tick and unobservable, but when a policy re-imposes state asynchronously the gap yields to the event loop and becomes observable. E.g.ExtensionSettings.onRemovereleases the per-extensionuninstall-/disable-extension:<id>locks, andonBeforeUIStartuponly re-imposes them afterawait AddonManager.getAllAddons(). - Since
onRemoveisn't awaited, an asynconRemovewould have its post-await teardown run after the re-apply and clobber the new state. Not reachable today because all onRemove callbacks are synchronous. But it rests on an implicit, unenforced contract thatonRemovemust be synchronous (currently, nothing checks it).
Proposal: add an optional onUpdate(manager, oldParams, newParams) callback, called instead of onRemove on a policy update, letting the policy transition in place and never release shared state. Policies without it keep today's remove-then-reapply behavior.
| Reporter | ||
Updated•20 days ago
|
Summary: Add an onUpdate callback to the live enterprise-policy engine for "atomic" policy updates → Add an onUpdate callback to the live enterprise-policy engine
| Reporter | ||
Updated•20 days ago
|
Summary: Add an onUpdate callback to the live enterprise-policy engine → Add an onUpdate callback to the live policy engine
You need to log in
before you can comment on or make changes to this bug.
Description
•