qiniu / dart-sdk

Qiniu Resource (Cloud) Storage SDK for Dart
24 stars 25 forks source link

Migrate to dio5.0 #66

Closed shirne closed 1 year ago

shirne commented 1 year ago
supermebing commented 1 year ago

也没人出来合并这个 然后发布到pub

shirne commented 1 year ago

也没人出来合并这个 然后发布到pub

测试方法:拉取dio分支到本地,修改flutter/pubspec.yaml 中qiniu_sdk_base的引用为path,然后运行flutter/example

qiniu_sdk_base: #^0.5.0
    path: ../base/

git引入的方法: 修改 qiniu_flutter_sdk 的引入方式为git,override qiniu_sdk_base的引入方式为git

dependency_overrides: 
  qiniu_sdk_base:
    git:
      url: https://github.com/shirne/qiniu-sdk
      ref: e3c64afce0d6546e3316a6b3adcd608f58adf81d
      path: base/
dependencies:
   ...
  qiniu_flutter_sdk:
    git:
      url: https://github.com/shirne/qiniu-sdk
      ref: e3c64afce0d6546e3316a6b3adcd608f58adf81d
      path: flutter/
yinxulai commented 1 year ago

首先真的非常感谢贡献代码 我们将会抽时间尽快审核代码

huangbinjie commented 1 year ago

我测了下,dio 好像把 Content-Type 的类型的默认值从 application/json 改成 application/x-www-form-urlencoded 了,你可以跑下 base 的测试吗

shirne commented 1 year ago

我测了下,dio 好像把 Content-Type 的类型的默认值从 application/json 改成 application/x-www-form-urlencoded 了,你可以跑下 base 的测试吗

我搞一个密钥跑一下看看

shirne commented 1 year ago

更新了dio版本到 5.0.1,其它测试通过了,put_bytes 这里还有几个没通过

Expected: StorageErrorType:<StorageErrorType.CANCEL>
  Actual: StorageErrorType:<StorageErrorType.RESPONSE>

应该是上传进度没有回调到导致的

shirne commented 1 year ago

@yinxulai @huangbinjie 分片上传初始化的时候返回了这个错误

"{error: incorrect region, please use up-z2.qiniup.com, bucket is: shirne}"

config_test中是通过的,地址是

https://upload-z2.qiniup.com

初始化地址为:

https://upload-na0.qiniup.com/buckets/shirne/objects/dGVzdF9mb3JfcHV0X3BhcnRzLm1wNA==/uploads
shirne commented 1 year ago

@yinxulai @huangbinjie 找到问题了,put/helpers下面还需要修改一个域名。

目前用了两个密钥测试都通过了。

22
huangbinjie commented 1 year ago

为啥升级下 dio 的版本就能解决分片上传的错误... @yinxulai 来看看把

shirne commented 1 year ago

为啥升级下 dio 的版本就能解决分片上传的错误... @yinxulai 来看看把

https://github.com/cfug/dio/commit/42b7eb838a3e6e73fdb93478b2992e0f36eba39b 是这个提交影响的,可能跟header有关

shirne commented 1 year ago

为啥升级下 dio 的版本就能解决分片上传的错误... @yinxulai 来看看把

cfug/dio@42b7eb8 是这个提交影响的,可能跟header有关

这个问题确认了,那个错误是在complete的post请求中抛出的。之前默认的contextType不正确,在dio5.0.1中自动检测contentType后修复了。 上面的commit 强制指定了contentType,在dio5.0.0中也可以正常运行

yinxulai commented 1 year ago

@huangbinjie 没大问题我可以先合进去但是先不发布,剩下的我再调整一下

huangbinjie commented 1 year ago

@yinxulai 有空看下为啥测试没触发

supermebing commented 1 year ago

挺长时间了 还不行?

yinxulai commented 1 year ago

@yinxulai 有空看下为啥测试没触发

qiniu 组织下的 travis 已经没有续订阅了,现在应该是转向了 actions,我尽快改造成 actions

huangbinjie commented 1 year ago

https://github.com/qiniu/dart-sdk/pull/66#discussion_r1147160067 @shirne 这个麻烦回复下

huangbinjie commented 1 year ago

qiniu 组织下的 travis 已经没有续订阅了,现在应该是转向了 actions,我尽快改造成 actions

@yinxulai 那你得整了啊,不然 master 也不跑

supermebing commented 1 year ago

每天关注一下 进度

supermebing commented 1 year ago

@AlexV525

huangbinjie commented 1 year ago

需要解决下冲突 @shirne

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 23.43% and project coverage change: -0.15 :warning:

Comparison is base (3b36dfd) 20.78% compared to head (62ab14d) 20.63%.

:exclamation: Current head 62ab14d differs from pull request most recent head 9ba1d16. Consider uploading reports for the commit 9ba1d16 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #66 +/- ## ========================================== - Coverage 20.78% 20.63% -0.15% ========================================== Files 30 27 -3 Lines 688 693 +5 ========================================== Hits 143 143 - Misses 545 550 +5 ``` | [Impacted Files](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu) | Coverage Δ | | |---|---|---| | [base/lib/src/storage/config/host.dart](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu#diff-YmFzZS9saWIvc3JjL3N0b3JhZ2UvY29uZmlnL2hvc3QuZGFydA==) | `0.00% <0.00%> (ø)` | | | [base/lib/src/storage/error/error.dart](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu#diff-YmFzZS9saWIvc3JjL3N0b3JhZ2UvZXJyb3IvZXJyb3IuZGFydA==) | `0.00% <0.00%> (ø)` | | | [...orage/methods/put/by\_part/complete\_parts\_task.dart](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu#diff-YmFzZS9saWIvc3JjL3N0b3JhZ2UvbWV0aG9kcy9wdXQvYnlfcGFydC9jb21wbGV0ZV9wYXJ0c190YXNrLmRhcnQ=) | `0.00% <0.00%> (ø)` | | | [...c/storage/methods/put/by\_part/init\_parts\_task.dart](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu#diff-YmFzZS9saWIvc3JjL3N0b3JhZ2UvbWV0aG9kcy9wdXQvYnlfcGFydC9pbml0X3BhcnRzX3Rhc2suZGFydA==) | `0.00% <0.00%> (ø)` | | | [...rc/storage/methods/put/by\_part/put\_parts\_task.dart](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu#diff-YmFzZS9saWIvc3JjL3N0b3JhZ2UvbWV0aG9kcy9wdXQvYnlfcGFydC9wdXRfcGFydHNfdGFzay5kYXJ0) | `0.00% <0.00%> (ø)` | | | [.../storage/methods/put/by\_part/upload\_part\_task.dart](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu#diff-YmFzZS9saWIvc3JjL3N0b3JhZ2UvbWV0aG9kcy9wdXQvYnlfcGFydC91cGxvYWRfcGFydF90YXNrLmRhcnQ=) | `0.00% <0.00%> (ø)` | | | [...storage/methods/put/by\_part/upload\_parts\_task.dart](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu#diff-YmFzZS9saWIvc3JjL3N0b3JhZ2UvbWV0aG9kcy9wdXQvYnlfcGFydC91cGxvYWRfcGFydHNfdGFzay5kYXJ0) | `0.00% <0.00%> (ø)` | | | [...rage/methods/put/by\_single/put\_by\_single\_task.dart](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu#diff-YmFzZS9saWIvc3JjL3N0b3JhZ2UvbWV0aG9kcy9wdXQvYnlfc2luZ2xlL3B1dF9ieV9zaW5nbGVfdGFzay5kYXJ0) | `0.00% <ø> (ø)` | | | [base/lib/src/storage/methods/put/put\_options.dart](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu#diff-YmFzZS9saWIvc3JjL3N0b3JhZ2UvbWV0aG9kcy9wdXQvcHV0X29wdGlvbnMuZGFydA==) | `0.00% <0.00%> (ø)` | | | [base/lib/src/storage/storage.dart](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu#diff-YmFzZS9saWIvc3JjL3N0b3JhZ2Uvc3RvcmFnZS5kYXJ0) | `10.71% <ø> (ø)` | | | ... and [5 more](https://codecov.io/gh/qiniu/dart-sdk/pull/66?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiniu)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

shirne commented 1 year ago

image 这个冲突怎么搞?先发布一下base的 0.5.0 ?

yinxulai commented 1 year ago

image 这个冲突怎么搞?先发布一下base的 0.5.0 ?

这个先忽略吧