From 472bcf453d5a055838afc120e316f1a8227fed50 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Wed, 7 Jan 2026 17:42:57 +0100 Subject: [PATCH 1/2] fix(uploader): queue is not empty when everything is skipped Signed-off-by: Grigorii K. Shartsev --- lib/uploader/uploader.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/uploader/uploader.ts b/lib/uploader/uploader.ts index d2584ea0..0f96c43e 100644 --- a/lib/uploader/uploader.ts +++ b/lib/uploader/uploader.ts @@ -326,6 +326,10 @@ export class Uploader { reject(error) } } finally { + // Upload queue is cleared when all the uploading jobs are done + // Meta upload unlike real uploading does not create a job + // Removing it manually here to make sure it is remove even when no uploading happened and there was nothing to finish + this._uploadQueue.splice(this._uploadQueue.indexOf(upload), 1) this._notifyAll(upload) this.updateStats() } From fe2bcede0c29cf88a027c8625a9ec0fe116a8f55 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Wed, 7 Jan 2026 19:53:24 +0100 Subject: [PATCH 2/2] test(uploader): add batchUpload tests with empty conflict result Signed-off-by: Grigorii K. Shartsev --- __tests__/uploader.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/__tests__/uploader.spec.ts b/__tests__/uploader.spec.ts index 0964ddc5..cb3fd6fc 100644 --- a/__tests__/uploader.spec.ts +++ b/__tests__/uploader.spec.ts @@ -122,4 +122,19 @@ describe('Uploader', () => { expect(() => { uploader.destination = newDestination as unknown as nextcloudFiles.Folder }).toThrowError(/invalid destination/i) }) }) + + describe('batchUpload', () => { + test('No upload when skipping all in conflict picker', async () => { + const uploader = new Uploader() + await uploader.batchUpload('/', [new File([], 'file.txt')], () => Promise.resolve([])) + vi.spyOn(uploader, 'upload') + expect(uploader.upload).not.toHaveBeenCalled() + }) + + test('Empty queue when skipping all in conflict picker', async () => { + const uploader = new Uploader() + await uploader.batchUpload('/', [new File([], 'file.txt')], () => Promise.resolve([])) + expect(uploader.queue).toHaveLength(0) + }) + }) })