core-3nweb-client-lib 0.53.9 → 0.53.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -509,7 +509,12 @@ class ObjStatus {
|
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
async adoptRemoteVersion(version) {
|
|
512
|
-
var _a;
|
|
512
|
+
var _a, _b;
|
|
513
|
+
if (((_a = this.upload) === null || _a === void 0 ? void 0 : _a.type) === 'removal') {
|
|
514
|
+
// uploads should have be cancelled before this is called (need a check),
|
|
515
|
+
// yet, outstanding removal was noted
|
|
516
|
+
this.upload == undefined;
|
|
517
|
+
}
|
|
513
518
|
const { local, remote } = this.status;
|
|
514
519
|
if (this.stateIndicator !== 'behind') {
|
|
515
520
|
if (this.stateIndicator === 'synced') {
|
|
@@ -526,7 +531,7 @@ class ObjStatus {
|
|
|
526
531
|
}
|
|
527
532
|
if (version) {
|
|
528
533
|
if ((remote.current === version)
|
|
529
|
-
|| ((
|
|
534
|
+
|| ((_b = remote.archived) === null || _b === void 0 ? void 0 : _b.includes(version))) {
|
|
530
535
|
this.status.synced = { version, base: remote.diffToBase[version] };
|
|
531
536
|
}
|
|
532
537
|
else {
|
|
@@ -83,9 +83,6 @@ class UpSyncer {
|
|
|
83
83
|
await obj.saveUploadHeaderFile(uploadHeader);
|
|
84
84
|
}
|
|
85
85
|
const task = await UploadTask.for(obj, localVersion, uploadVersion, uploadHeader === null || uploadHeader === void 0 ? void 0 : uploadHeader.uploadHeader, syncedBase, createOnRemote, uploadTaskId, eventSink, this.remoteStorage, async () => {
|
|
86
|
-
if (this.tasksByIds.delete(task.taskId)) {
|
|
87
|
-
this.tasksByObjIds.delete(task.objId);
|
|
88
|
-
}
|
|
89
86
|
await obj.recordUploadCompletion(localVersion, uploadVersion, (uploadHeader ? {
|
|
90
87
|
newHeader: uploadHeader.uploadHeader,
|
|
91
88
|
originalHeader: uploadHeader.localHeader
|
|
@@ -97,7 +94,11 @@ class UpSyncer {
|
|
|
97
94
|
this.tasksByIds.set(uploadTaskId, task);
|
|
98
95
|
this.tasksByObjIds.set(task.objId, task);
|
|
99
96
|
const completion = task.completion();
|
|
100
|
-
completion.
|
|
97
|
+
completion.finally(() => {
|
|
98
|
+
if (this.tasksByIds.delete(task.taskId)) {
|
|
99
|
+
this.tasksByObjIds.delete(task.objId);
|
|
100
|
+
}
|
|
101
|
+
}).catch(noop);
|
|
101
102
|
this.execPools.add(task);
|
|
102
103
|
return { completion, uploadTaskId };
|
|
103
104
|
});
|
|
@@ -1091,9 +1091,10 @@ class FolderNode extends node_in_fs_1.NodeInFS {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
if (renamed) {
|
|
1093
1093
|
for (const { local, remote, renamedIn } of renamed) {
|
|
1094
|
-
if (renamedIn === 'r') {
|
|
1094
|
+
if ((renamedIn === 'r') || (renamedIn === 'l&r')) {
|
|
1095
1095
|
const node = nodes[local];
|
|
1096
1096
|
(0, assert_1.assert)(!!node);
|
|
1097
|
+
delete nodes[local];
|
|
1097
1098
|
node.name = remote;
|
|
1098
1099
|
nodes[node.name] = node;
|
|
1099
1100
|
events.push({
|
|
@@ -1101,9 +1102,6 @@ class FolderNode extends node_in_fs_1.NodeInFS {
|
|
|
1101
1102
|
childObjId: node.objId
|
|
1102
1103
|
});
|
|
1103
1104
|
}
|
|
1104
|
-
else if (renamedIn === 'l&r') {
|
|
1105
|
-
// XXX use mtime to suggest which name to adopt -- TODO
|
|
1106
|
-
}
|
|
1107
1105
|
}
|
|
1108
1106
|
}
|
|
1109
1107
|
if (added === null || added === void 0 ? void 0 : added.inRemote) {
|