Skip to content

Add retry callback #317

@fregante

Description

@fregante

For situations like https://github.com/pixiebrix/pixiebrix-source/pull/1438

It would replace:

const offscreenPage = { page: "offscreen" };

export const clearRecordings = wrapEnsureOffscreenDocumentInBackground(
  getMethod("CLEAR_RECORDINGS", offscreenPage),
);

with

const offscreenPage = { page: "offscreen", retryCallback: ensureOffscreenDocument };

export const clearRecordings = getMethod("CLEAR_RECORDINGS", offscreenPage);

which will call ensureOffscreenDocument after the first failure. The callback will be called with the error received so it can determine whether it's related to a missing offscreen (however it the internal retry logic I think only fails in case of broken communication)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions