From a304dbc07c0c2be0c49ac754482ecff7bc6e62e6 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Sat, 10 Oct 2026 16:18:51 +0800 Subject: [PATCH] fix(sftp): use create-only saves for new files --- ui/koko/composables/sftp/useSftpOperations.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/koko/composables/sftp/useSftpOperations.ts b/ui/koko/composables/sftp/useSftpOperations.ts index 13e717e5f..b72d6d010 100644 --- a/ui/koko/composables/sftp/useSftpOperations.ts +++ b/ui/koko/composables/sftp/useSftpOperations.ts @@ -512,9 +512,7 @@ export function useSftpOperations(currentPath: Ref, socket: SftpSocketCl listDirectory, createDirectory: (name) => mutatePath(SftpCommand.MakeDirectory, joinSftpPath(currentPath.value, name)), createDirectoryAt: (path) => mutatePath(SftpCommand.MakeDirectory, path), - // koko parses upload message IDs as integers, including empty-file uploads. - createFileAt: (path) => - uploadQueue.enqueue(() => sendUpload(String(Date.now()), { offset: 0, size: 0, path, chunk: false })), + createFileAt: (path) => saveFile(path, new Uint8Array(), { expectedVersion: "absent" }).then(() => undefined), renameEntry: (entry, name) => mutatePath(SftpCommand.Rename, joinSftpPath(currentPath.value, entry.name), { new_name: name }), renamePath: (path, name) => mutatePath(SftpCommand.Rename, path, { new_name: name }),