Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: network error has not been properly detected #13935

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

HuiSF
Copy link
Member

@HuiSF HuiSF commented Oct 17, 2024

Description of changes

  1. the isConnectionError of the defaultRetryDecider now detects network errors by looking up the name property to match either one of the [NetworkError, ERR_NETWORK]
    • NetworkError is thrown from the fetch transfer handler Core
    • ERR_NETWORK is thrown from the XHR transfer handler resides in Storage
  2. the tokenOrchestrator.handleErrors method now detects network errors by looking up the name property to match NetworkError, clearTokens() shall not be called when the error is a network error

Issue #, if available

Description of how you validated changes

  1. manual testing with a Next.js app and a react-native app
  2. unit tests

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@HuiSF HuiSF force-pushed the hui/fix/core/retry-with-hermes branch from 7b79bc4 to 3af63c4 Compare October 17, 2024 22:09
@HuiSF HuiSF requested a review from a team as a code owner October 17, 2024 22:23
Copy link
Member

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks a lot!

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.

4 participants