- Notifications
You must be signed in to change notification settings - Fork 0
Add axios error codes to the UserCacheService to hopefully better detect when API errors are network related #89
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
Conversation
…ect when API errors are network related
WalkthroughBump from 3.2.4 → 3.2.5 across app/version metadata and Android build config, plus an enhancement in UserCacheService to broaden detection of network/Axios error variants during offline sync handling. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Areas to review:
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/services/offlineV2/UserCacheService.ts (1)
2105-2114: Ensure axiosERR_NETWORKis actually present inerrorMessageYou’re now treating errors whose message contains
"Network Error"or"ERR_NETWORK"as offline, which is good for axios-based failures. However,errorMessagehere is justerror.messagefrom the thrownSyncError, not the original axios error, soerrorMessage.includes("ERR_NETWORK")will only ever be true if your ApiService/SyncError explicitly embed the axioserror.codeinto the message string.If your intent is to key off axios’
error.code === "ERR_NETWORK", consider either:
- Ensuring the wrapped error message always includes that code, or
- Extending this check to also inspect the error object (e.g.
(error as any).code === "ERR_NETWORK") in addition to the message.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
android/app/build.gradle(1 hunks)android/app/src/main/res/values/strings.xml(1 hunks)app.json(3 hunks)package.json(1 hunks)src/services/offlineV2/UserCacheService.ts(1 hunks)
🔇 Additional comments (4)
package.json (1)
4-4: Version bump looks consistentApp version is updated to
3.2.5, matching the rest of the PR’s versioning; nothing else in this manifest changes.android/app/build.gradle (1)
95-96: Android versionCode/versionName aligned
versionCode 190andversionName "3.2.5"are in sync with app.json and package.json; Android config looks good.android/app/src/main/res/values/strings.xml (1)
4-4: Runtime version string matches app config
expo_runtime_versionset to3.2.5matches the runtimeVersion in app.json; this keeps OTA/runtime in sync.app.json (1)
6-6: Expo/app/Android versions are coherently bumped
version: "3.2.5",android.versionCode: 190, andruntimeVersion: "3.2.5"are all aligned with the Android Gradle config and package.json; release metadata is consistent.Also applies to: 19-19, 61-61
Summary by CodeRabbit
Chores
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.