Closed Bug 2037867 Opened 14 days ago Closed 12 hours ago

Clear policy-set default value after policy removal when no cached default value exists

Categories

(Firefox Enterprise :: Client, defect, P1)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: janika, Assigned: janika)

References

(Blocks 3 open bugs)

Details

Attachments

(1 file)

When a policy is modifying a preference's default value, we save the preference's default and user value in savePreferenceState. When the policy is removed, we restore the preference's default and user value in restorePreferenceState. But we currently only restore a previous value state if a previous one existed, hence a policy-set default can survive the policy removal if there is no value to restore.

This issue highlights the question of what preference state is expected after a policy removal. Some exemplary cases:

  • A policy sets a preference's default value and locks it --> We restore both the default and user value of that preference.
  • A policy set a preference's default value and doesn't lock it. --> We restore only the default value of that preference.
  • A policy sets the preference's user value. --> We restore the user value. (That's currently not supported as we only cache the preference state when the default value is changed)
Severity: -- → S1
Priority: -- → P1

Additional limitation: cache does not survive a restart

_initialPrefState is in-memory only, but policy-driven user value changes (via Services.prefs.setXXX) or any policy-unrelated user value changes are persisted to disk. Once the browser is restarted, the cached "previous state" is gone, so the original value can no longer be restored.

Status: NEW → RESOLVED
Closed: 12 hours ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: