fix onedrive issue in enc

This commit is contained in:
fyears 2024-05-08 22:37:29 +08:00
parent e66b0c71c4
commit 2a3df8ab53
9 changed files with 38 additions and 1 deletions

View File

@ -16,4 +16,5 @@ export abstract class FakeFs {
abstract checkConnect(callbackFunc?: any): Promise<boolean>;
abstract getUserDisplayName(): Promise<string>;
abstract revokeAuth(): Promise<any>;
abstract allowEmptyFile(): boolean;
}

View File

@ -736,4 +736,8 @@ export class FakeFsDropbox extends FakeFs {
return false;
}
}
allowEmptyFile(): boolean {
return true;
}
}

View File

@ -273,9 +273,13 @@ export class FakeFsEncrypt extends FakeFs {
return copyEntityAndCopyKeyEncSizeEnc(innerEntity);
} else {
const now = Date.now();
let content = new ArrayBuffer(0);
if (!this.innerFs.allowEmptyFile()) {
content = new ArrayBuffer(1);
}
const innerEntity = await this.innerFs.writeFile(
keyEnc,
new ArrayBuffer(0),
content,
mtime ?? now,
ctime ?? now
);
@ -554,4 +558,8 @@ export class FakeFsEncrypt extends FakeFs {
async revokeAuth(): Promise<any> {
return await this.innerFs.revokeAuth();
}
allowEmptyFile(): boolean {
return true;
}
}

View File

@ -170,4 +170,8 @@ export class FakeFsLocal extends FakeFs {
async revokeAuth(): Promise<any> {
throw new Error("Method not implemented.");
}
allowEmptyFile(): boolean {
return true;
}
}

View File

@ -49,4 +49,8 @@ export class FakeFsMock extends FakeFs {
async revokeAuth(): Promise<any> {
throw new Error("Method not implemented.");
}
allowEmptyFile(): boolean {
throw new Error("Method not implemented.");
}
}

View File

@ -928,4 +928,8 @@ export class FakeFsOnedrive extends FakeFs {
async getRevokeAddr() {
return "https://account.live.com/consent/Manage";
}
allowEmptyFile(): boolean {
return false;
}
}

View File

@ -817,4 +817,8 @@ export class FakeFsS3 extends FakeFs {
async revokeAuth() {
throw new Error("Method not implemented.");
}
allowEmptyFile(): boolean {
return true;
}
}

View File

@ -493,4 +493,8 @@ export class FakeFsWebdav extends FakeFs {
async revokeAuth() {
throw new Error("Method not implemented.");
}
allowEmptyFile(): boolean {
return true;
}
}

View File

@ -239,4 +239,8 @@ export class FakeFsWebdis extends FakeFs {
async revokeAuth(): Promise<any> {
throw new Error("Method not implemented.");
}
allowEmptyFile(): boolean {
return true;
}
}