Task Summary
onClickAbortUploadProgress is the largest uncovered block in DatasetDetailComponent (roughly 60 lines) and the one with the most ways to go wrong.
Aborting an in-flight upload has to survive the backend still finalizing a previous attempt, so the abort call is retried on 409:
| Response |
Behaviour |
| success |
notify, report the abort |
| 404 |
already gone — report the abort, no error |
409, attempt < ABORT_RETRY_MAX_ATTEMPTS |
retry after ABORT_RETRY_BACKOFF_BASE_MS * (attempt + 1) |
| 409 at the limit, or any other status |
give up, but still report the abort |
Alongside the retry ladder: the progress subscription is unsubscribed so a late event cannot resurrect the task, the concurrency slot is released via onUploadComplete() so a queued upload can start, the task moves to aborted, and cancelExistingUpload delegates here for an upload that is still running.
Both constants are exported, so the backoff growth and the attempt bound can be asserted rather than hard-coded. vi.useFakeTimers() is needed to step the backoff.
The existing "upload queue" describe already has the harness: a multipartUpload stub handing back a Subject per file, and a finalizeMultipartUpload stub to drive the responses above.
Task Type
Task Summary
onClickAbortUploadProgressis the largest uncovered block inDatasetDetailComponent(roughly 60 lines) and the one with the most ways to go wrong.Aborting an in-flight upload has to survive the backend still finalizing a previous attempt, so the abort call is retried on 409:
ABORT_RETRY_MAX_ATTEMPTSABORT_RETRY_BACKOFF_BASE_MS * (attempt + 1)Alongside the retry ladder: the progress subscription is unsubscribed so a late event cannot resurrect the task, the concurrency slot is released via
onUploadComplete()so a queued upload can start, the task moves toaborted, andcancelExistingUploaddelegates here for an upload that is still running.Both constants are exported, so the backoff growth and the attempt bound can be asserted rather than hard-coded.
vi.useFakeTimers()is needed to step the backoff.The existing "upload queue" describe already has the harness: a
multipartUploadstub handing back aSubjectper file, and afinalizeMultipartUploadstub to drive the responses above.Task Type