Skip to content

Conversation

@devlopharsh
Copy link

Related Tickets & Documents

Fixes: #3670

Description

Issue : fetchAPI does not defensively handle common HTTP and network failure scenarios. As a result, failures propagate in unclear or uncontrolled ways, making them difficult to diagnose and potentially harmful to production stability.

Changes

  • Implement retry with backoff for 5xx/429 ,
  • handle API with timeout ,
  • add structured error type for consumers .

Type of Change

  • Chore (maintenance, refactoring, tooling updates)
  • Bug fix (non-breaking change that fixes an issue)
  • New feature (change that adds functionality)
  • Breaking Change (may require updates in existing code)
  • UI improvement (visual or design changes)
  • Performance improvement (optimization or efficiency enhancements)
  • Documentation update (changes to README, guides, etc.)
  • CI (updates to continuous integration workflows)
  • Revert (undo a previous commit or merge)

Testing

  • Successfully build and run the project , faced no issue .
  • Tested the done feature manually , faced no issues .

Environment and Dependencies

  • New Dependencies: NA
  • Configuration Changes: WORDPRESS_API_TIMEOUT_MS = x (x is in second)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added corresponding tests
  • I have run the build command to ensure there are no build errors
  • My changes have been tested across relevant browsers/devices
  • For UI changes, I've included visual evidence of my changes

Signed-off-by: developharsh <harsh237hk@gmail.com>
@devlopharsh
Copy link
Author

@amaan-bhati @Achanandhi-M , please review the PR and acknowledge about the changes needed, thank you : )

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.

[feature]: Improve fetchAPI robustness: explicit HTTP error handling, timeouts, and retry strategy

1 participant