Skip to content

Cover aborting a dataset upload and its conflict retry #7413

Description

@aglinxinyuan

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

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions