fix(client): work through the findings from the coverage pass

214 items came out of writing the tests. Real defects are corrected, dead code
is removed rather than covered, and the tests that pinned the old behaviour
move with them.

Also drops two agent coverage scratch files that slipped into the coverage PR
and adds the ignore rule that keeps them out.
This commit is contained in:
Maurice
2026-07-29 11:57:24 +02:00
committed by Maurice
parent a4bf815d24
commit 72a82b3c44
425 changed files with 3155 additions and 1968 deletions
+17 -1
View File
@@ -1,4 +1,4 @@
// FE-W4UPQ-001 to FE-W4UPQ-010
// FE-W4UPQ-001 to FE-W4UPQ-012
import { describe, it, expect, vi } from 'vitest'
import { uploadFilesResilient, type UploadOpts, type UploadProgress } from './uploadQueue'
@@ -139,4 +139,20 @@ describe('uploadFilesResilient', () => {
expect(uploadOne).not.toHaveBeenCalled()
expect(res).toEqual({ succeeded: [], failed: [] })
})
it('FE-W4UPQ-012: the bytes of an aborted attempt do not survive into the retry', async () => {
const seen: UploadProgress[] = []
let attempt = 0
const uploadOne = async (f: File, opts: UploadOpts) => {
attempt++
opts.onUploadProgress({ loaded: f.size / 2, total: f.size } as never)
if (attempt === 1) throw new Error('connection reset')
return [f.name]
}
await uploadFilesResilient([file('a.txt', 200)], uploadOne, { retries: 1, onProgress: p => { seen.push(p) } })
// 50% from the aborted attempt, then back to 0 before the retry reports its own.
expect(seen.map(p => p.percent)).toEqual([50, 0, 50, 100])
})
})