Closed Bug 1908201 Opened 1 year ago Closed 1 year ago

Validation of native messaging path should be in NativeManifests.sys.mjs, not in NativeMessaging.sys.mjs

Categories

(WebExtensions :: General, task)

task

Tracking

(firefox130 fixed)

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

Bug 1772932 introduced a check and throws an explicit error when a path is not absolute.
The error is NativeApp requires absolute path to command on this platform (source), and because the implementation throws an Error instead of ExtensionError, the message is redacted and the extension receives "An unexpected error occurred".

Before the change, the same redacted error would have been observed, with the logged error being "File at path [path] does not exist, or is not executable" (source in Subprocess module).

All of this is somewhat late - if the path is not absolute, it is an issue with the native manifest, and validation should therefore happen before earlier, in NativeManifests.sys.mjs. Doing so would also enable the implementation to fall back to the generic No such native application [native messaging id] error.

Blocks: 1907190
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/0ec1c020f613 Validate native messaging path earlier r=willdurand

Backed out for causing xpcshell failures on test_ext_native_messaging.js

[task 2024-07-16T23:51:24.534Z] 23:51:24     INFO -  TEST-START | toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js
[task 2024-07-16T23:56:24.537Z] 23:56:24  WARNING -  TEST-UNEXPECTED-TIMEOUT | toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js | Test timed out
[task 2024-07-16T23:56:24.537Z] 23:56:24     INFO -  TEST-INFO took 300004ms
[task 2024-07-16T23:56:24.538Z] 23:56:24     INFO -  >>>>>>>
[task 2024-07-16T23:56:24.538Z] 23:56:24     INFO -  (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2024-07-16T23:56:24.539Z] 23:56:24     INFO -  (xpcshell/head.js) | test run_next_test 0 pending (2)
[task 2024-07-16T23:56:24.539Z] 23:56:24     INFO -  (xpcshell/head.js) | test MAIN run_test finished (2)
[task 2024-07-16T23:56:24.539Z] 23:56:24     INFO -  running event loop
[task 2024-07-16T23:56:24.539Z] 23:56:24     INFO -  toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js | Starting setup check_remote
[task 2024-07-16T23:56:24.540Z] 23:56:24     INFO -  (xpcshell/head.js) | test check_remote pending (2)
[task 2024-07-16T23:56:24.540Z] 23:56:24     INFO -  TEST-PASS | toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js | check_remote - [check_remote : 1] useRemoteWebExtensions matches - false == false
Flags: needinfo?(rob)
Flags: needinfo?(rob)
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/60c1df36ab0e Validate native messaging path earlier r=willdurand
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: