Skip to content

fix(fetchium): Replace AbortSignal APIs unavailable on Hermes - #7

Merged
jimmy-phantom merged 1 commit into
mainfrom
fix/retry-hermes-compat
Apr 13, 2026
Merged

jimmy-phantom merged 1 commit into
mainfrom
fix/retry-hermes-compat

Conversation

@jimmy-phantom

@jimmy-phantom jimmy-phantom commented Apr 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • withRetry() called signal.throwIfAborted() which doesn't exist on Hermes (React Native's JS engine). The resulting TypeError was caught by the retry loop, treated as a transient failure, and retried with backoff until exhaustion. No network request was ever made.
  • signal.reason is also undefined on Hermes, so abort rejections in sleep() carried no error information.
  • Replaced throwIfAborted() with a manual signal.aborted check and extracted a getAbortReason() helper that falls back to an AbortError when signal.reason is unavailable. The fallback also handles engines where DOMException is not globally defined.

Test plan

  • All 1124 existing unit tests pass
  • Type-checking passes (tsc --noEmit)
  • Verify on React Native (Hermes) that queries no longer silently fail

🤖 Generated with Claude Code

`withRetry` called `signal.throwIfAborted()` which doesn't exist on
Hermes (React Native's JS engine), causing a TypeError that the retry
loop silently swallowed and retried until exhaustion, so no network
request was ever made. `signal.reason` is also undefined on Hermes,
meaning abort rejections carried no error info.

Replace `throwIfAborted()` with a manual `signal.aborted` check and
extract a `getAbortReason()` helper that falls back to an AbortError
when `signal.reason` is unavailable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jimmy-phantom
jimmy-phantom requested a review from pzuraq April 12, 2026 21:53
@jimmy-phantom
jimmy-phantom merged commit a498bc9 into main Apr 13, 2026
1 check passed
@jimmy-phantom
jimmy-phantom deleted the fix/retry-hermes-compat branch April 13, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants