Skip to content

Query is not finished if invalid contract and use retry with filter #521

@sagdeev

Description

@sagdeev

The request does not complete if the contract is invalid and there is a retry with a filter

export const query = createJsonMutation({
  name: 'demo',
  params: declareParams<string | null>(),
  request: {
    method: 'POST',
    url: $apiUrl,
    body: {
      source: $context,
      fn: (params, context) => ({
        context,
        action: params ?? {},
      }),
    },
    headers: $headers,
  },
  response: {
    contract: runtypeContract(String),
    status: { expected: [200, 204] },
  },
});

retry(query, {
      times: 3,
      delay: linearDelay(500),
      filter: isNetworkError,
    });

But if you delete the filter or add supressIntermediateErrors: false the problem will be solved

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions