Skip to content

fix(upload): complete cancelAll when some uploads already finished#2235

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-identification-39e3
Draft

fix(upload): complete cancelAll when some uploads already finished#2235
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-identification-39e3

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 25, 2026

Description

Fixes UploadFilesResponse.cancelAll() so it cancels every non-completed background upload and still calls Workmanager().cancelAll(). Previously the loop used return when it saw a completed task, which aborted the whole operation on the first completed entry.

Related Issue

None filed.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)

What Has Changed

  • In UploadFilesResponse.methods()['cancelAll'], replace mistaken return with continue when skipping tasks that are already UploadStatus.completed.

How to Test

  1. From modules/ensemble, run flutter test (Flutter SDK on PATH per AGENTS.md).
  2. Manual: start multiple file uploads tracked on one response object; let one finish, call cancelAll() from script, and confirm remaining uploads are marked cancelled and workmanager cleanup runs.

Screenshots / Videos

N/A

Checklist

  • I have run flutter analyze and addressed any new warnings
  • I have run flutter test and all tests pass
  • I have tested my changes on the relevant platform(s)
  • I have updated documentation if needed
  • My changes do not introduce new warnings or errors

Note: The CI image used for this automation did not have the Flutter SDK installed, so flutter analyze / flutter test were not executed here. Please run them locally per AGENTS.md.

Duplicate check

Open in Web View Automation 

cancelAll used `return` inside the task loop, so the first completed upload
skipped cancelling remaining tasks and never called Workmanager.cancelAll().
Use `continue` instead so only completed entries are skipped.

Co-authored-by: Sharjeel Yunus <sharjeelyunus@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant