TencentCloud / TencentCloud/cos-sdk-react-native-plugin
【iOS】断网情况下触发 failCallBack,但 error 为 null(Android 正常)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
问题描述
在使用 cos-sdk-react-native-plugin 的过程中,iOS 下如果设备处于断网状态,会进入 resultListener.failCallBack,但是 error 参数为 null。
而在 Android 下相同场景 会正常返回带有 errorCode 和 message 的错误对象。
复现步骤
1、在 React Native 项目中集成 cos-sdk-react-native-plugin。
2、调用 cos.upload() 上传一个文件。
3、将 iOS 设备断开网络。
4、观察回调参数。
预期结果
在 iOS 下,failCallBack 应该返回一个非空的 error 对象,与 Android 表现保持一致,例如:
{
errorCode: 20002,
message: 'Network unavailable, upload paused'
}
实际结果
iOS:failCallBack 被触发,但 error 为 null。
Android:failCallBack 返回包含错误信息的对象(正常)。
环境信息
平台:iOS
版本:1.2.1
React Native 版本:0.79.6
补充说明
由于 iOS 与 Android 行为不一致,目前在断网情况下无法统一处理上传失败的逻辑。
希望在 iOS 下也能返回与 Android 一致的错误对象。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the React Native cos.upload() path to the iOS implementation of resultListener.failCallBack, then compare how the Android path constructs its error object. Reproduce the offline upload scenario on iOS and verify that the callback receives a non-null error with an errorCode and message consistent with Android.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100