Closed Bug 2067099 Opened 2 months ago Closed 2 months ago

Handlers unresolvable MIME type prevents later handler entries from being processed

Categories

(Enterprise Products :: Firefox, defect)

defect

Tracking

(firefox-esr153 fixed, firefox157 fixed)

VERIFIED FIXED
157 Branch
Tracking Status
firefox-esr153 --- fixed
firefox157 --- fixed

People

(Reporter: bsmth, Assigned: mkaply)

References

Details

Attachments

(1 file, 2 external files)

Handlers.onBeforeAddons wraps extensions in try/catch but not the 'mimeTypes', so an unresolvable MIME type throws out of the whole callback and discards every later mimeTypes entry plus the extensions and schemes blocks.

STR:

Given a policy with this shape:

{
  "policies": {
    "Handlers": {
      "mimeTypes": { "": { "action": "saveToDisk" } },
      "extensions": { "": { "action": "saveToDisk" } }
    }
  }
}

Expectation: the mimeTypes key is skipped with a diagnostic naming it, the rest of the policy applies, exactly as the extensions branch already behaves.

Actual: No warning about Invalid file extension, so the extensions section never ran, it's discarded.

An empty string is the smallest trigger, but any MIME type the service cannot resolve does this.

See Also: → 2067123
Assignee: nobody → mozilla
Pushed by mozilla@kaply.com: https://github.com/mozilla-firefox/firefox/commit/674ab89622d7 https://hg.mozilla.org/integration/autoland/rev/1e4c5463439b Contain unresolvable Handlers entries so later entries are still processed. r=bsmth
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch
Regressions: 2067918
Flags: needinfo?(mozilla)
Flags: needinfo?(lissyx+mozillians)
Flags: needinfo?(mozilla)
Flags: needinfo?(lissyx+mozillians)

I will set up a herald rule to watch this file so that I can keep ahead of changes and hopefully even avoid thr test failures. But this is great to see things are working to keep us in sync!

Flags: qe-verify+
Attached image Release vs Nightly β€”

Hello,
I checked this today on Windows 11, using Nightly 157.0a1 (20260908080322), and specific errors are now displayed in about:policies.
Is this the expected result for the fix made in this ticket?
Thank you.

Flags: needinfo?(brismith)

Hello,
I checked this today on Windows 11, using Nightly 157.0a1 (20260908080322), and specific errors are now displayed in about:policies.
Is this the expected result for the fix made in this ticket?
Thank you.

QA Contact: lburuian

Yes, thanks. Nightly reports both problems - the second one confirms that processing continued into the extensions block instead of stopping at the invalid MIME type.

Flags: needinfo?(brismith)

Thank you for confirming, Brian.
Marking this as verified.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Original Revision: https://phabricator.services.mozilla.com/D321971

(cherry picked from commit 674ab89622d796e216e1d41b5a5ff7e4bfc62d51)

Rebased for ESR 153: the helper functions moved to
toolkit/components/enterprisepolicies/PoliciesHelpers.sys.mjs in Bug 2048572,
which is not on ESR 153. The processMIMEInfo change is applied in its
pre-refactor location in browser/components/enterprisepolicies/Policies.sys.mjs
and the lazy.processMIMEInfo call sites are unprefixed accordingly.

Attachment #9646396 - Flags: approval-mozilla-esr153?
Attachment #9646396 - Flags: approval-mozilla-esr153? → approval-mozilla-esr153+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: