unjs / unjs/ofetch

default retry is not able to be aware

Open
#334 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.4k
Forks
195
PR merge metrics
No merged PRs in 30d

Description

Environment

v16.18.1

Reproduction
await $fetch("/404", {
  onRequestError(context) {
    context.options.retry // undefined
  },
});

but there is a implicit retry

Describe the bug

see reproduction

Additional context

No response

Logs

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided $fetch reproduction and trace how onRequestError receives context.options.retry. Confirm where the implicit retry is configured or applied, then verify that the context exposes the effective retry value while handling the /404 request.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.