Skip to content

Remove the action queue mechanism #21068

@pedronfigueiredo

Description

@pedronfigueiredo

Context

For our purposes at MetaMask, one of the most significant differences between manifest v3 and v2 extension implementations was that the background process runs on a service worker that restarts every 5 minutes. However, we recently learned that Chrome dropped that requirement, which means the mv3-specific code still needs to persist in the service worker state, but the implementation can be simplified from what we have previously implemented.
To remove the action queue functionality, we can essentially un-deprecate callBackgroundMethod and simplify it as well as submitRequestToBackground.

We can also simply call background.<bckgMethod>, but since these methods use callbacks, it's still useful to keep a wrapper function around the background methods that promisifies them.

Reference MR which added action queue previously:
#15337

Approach

  • un-deprecate callBackgroundMethod in and simplify the implementation by removing v3 retrying queue related work, and only keep
    background?.[method](...args, callback);
  • simplify submitRequestToBackground method and simplify as the implementation by removing v3 retrying queue related work, and only keep
      return promisifiedBackground?.[method](
    ...(args ?? []),
  ) as unknown as Promise<R>;
  • delete other unused helper function
  • removed the usage of submitRequestToBackground

Acceptance Criteria

  • Clean up action queue related mv3 implementations
  • Clean up submitRequestToBackground and callBackgroundMethod
  • Success build MV3

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions