Skip to content

Commit ebb3b46

Browse files
authored
bump base version to v0.6.1, fix the bug that uploaded content could be wrong after recovering (#84)
1 parent 699a507 commit ebb3b46

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

base/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.1
2+
3+
- 修复分片上传中断恢复后文件内容出错的问题
4+
15
## 0.6.0
26

37
- 更新 uuid 到最新版本,对 Flutter SDK 的最低版本要求提升到 3.0

base/lib/src/storage/methods/put/by_part/upload_parts_task.dart

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,20 @@ class UploadPartsTask extends RequestTask<List<Part>> with CacheMixin {
140140
// partNumber 按照后端要求必须从 1 开始
141141
final partNumber = ++_uploadingPartIndex;
142142

143-
// 跳过上传过的分片
144-
final uploadedPart = _uploadedPartMap[partNumber];
145-
if (uploadedPart != null) {
146-
_sentPartCount++;
147-
_sentPartToServerCount++;
148-
notifySendProgress();
149-
notifyProgress();
150-
continue;
151-
}
152-
153143
await for (var bytes in resource.stream) {
154-
final future =
155-
_createUploadPartTaskFutureByPartNumber(bytes, partNumber);
156-
157-
taskFutures.add(future);
144+
// 跳过上传过的分片
145+
final uploadedPart = _uploadedPartMap[partNumber];
146+
if (uploadedPart != null) {
147+
_sentPartCount++;
148+
_sentPartToServerCount++;
149+
notifySendProgress();
150+
notifyProgress();
151+
} else {
152+
final future =
153+
_createUploadPartTaskFutureByPartNumber(bytes, partNumber);
154+
155+
taskFutures.add(future);
156+
}
158157
break;
159158
}
160159
}

base/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: qiniu_sdk_base
2-
version: 0.6.0
2+
version: 0.6.1
33
homepage: https://github.com/qiniu/dart-sdk
44
description: The sdk basic of Qiniu products
55

0 commit comments

Comments
 (0)