feat(api): implement 403, 429, and 500+ error handling with exponential backoff#69
Merged
RUKAYAT-CODER merged 5 commits intorinafcode:mainfrom Apr 26, 2026
Merged
Conversation
|
@Shadow-MMN Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
kindly resolve conflict |
Author
ok so sorry just seeing this now |
Author
|
@RUKAYAT-CODER please check them out now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #53
Description
This PR enhances the API error handling in
axios.config.tsto improve resilience and user experience. It adds specific handlers for forbidden access, rate limiting, and server-side errors.Changes
Utility: Integrated a
getBackoffTimehelper for consistent delay calculations.Verification Results
Existing Issues & Observations
npm run test), I observed that thepushNotificationsservice tests and utility handlers are currently failing due to TypeScript mismatches (likely caused by a recentexpo-notificationsversion update).NotificationTriggerInputis missing the requiredtypeproperty in test mocks, andremoveNotificationSubscriptionis missing from the mock type.Suggestions for Further Enhancement
Based on my review of the codebase, here are a few low-hanging fruits I'd recommend:
useNetworkStatushook detects the device is back online.apiClientwith a global toast/notification store to show these user-friendly messages automatically to the user.isSessionValidutility insecureStorage.tscould be used in a background timer/hook to refresh the token before it actually expires,reducing the latency caused by the 401 interceptor trigger.