Closed Bug 1738518 Opened 3 years ago Closed 3 years ago

Automated return value verification in manifest v3 era - add a "returns" key to the schema files

Categories

(WebExtensions :: General, task)

task

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1515820

People

(Reporter: TbSync, Unassigned)

Details

I was informed today, that the callback mechanism for WebExtension API functions is going to be removed in manifest v3 and returning a Promise is going to be enforced.

The callback mechanism is enabled by using async: "callback" instead of async: true in the schema files. See https://searchfox.org/mozilla-central/search?q=%22async%22%3A+%22callback%22&path=&case=false&regexp=false

While the callback mechanism itself was not widely used by Firefox Add-on developers, it did allow automated verification of WebExtension API return values in our tests in debug builds, because the return values were actually defined in the schema files (the verification kicked in even if the test used the returned Promise instead of the callback).

With the callback mechanism being removed, it is no longer possible to define the return value of an API in the schema and thus no automated testing can be done.

I think this will do no good for our QA. Even though it is not part of the spec, can we add a dedicated "returns" field in our v3 schema files and use that for verification in debug builds? Or do we still have a say in the specs and can add that field?

The automated testing is just one thing which needs the return value definition in the schema. Generating a type definition file for TypeScript or generating a documentation from the schema files also need the return values.

(In reply to John Bieling (:TbSync) from comment #0)

I was informed today, that the callback mechanism for WebExtension API functions is going to be removed in manifest v3 and returning a Promise is going to be enforced.

This is not happening, at least in Firefox, not sure where you heard that.

The rest of this bug is a duplicate of bug 1515820.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE

This is not happening, at least in Firefox, not sure where you heard that.

Philipp Kewisch (Fallen) told me about the removal of the callback support in manifest v3.

You need to log in before you can comment on or make changes to this bug.