From 2626ea5afb24eda23f3ba75c80eec4cae9ce8afb Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 25 May 2026 11:06:27 +0000 Subject: [PATCH] fix(upload): complete cancelAll when some tasks are already completed 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 --- modules/ensemble/lib/framework/data_context.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ensemble/lib/framework/data_context.dart b/modules/ensemble/lib/framework/data_context.dart index d964e69ac..ed5ebd8f8 100644 --- a/modules/ensemble/lib/framework/data_context.dart +++ b/modules/ensemble/lib/framework/data_context.dart @@ -1180,7 +1180,7 @@ class UploadFilesResponse with Invokable { }, 'cancelAll': () async { for (var task in tasks) { - if (task.status == UploadStatus.completed) return; + if (task.status == UploadStatus.completed) continue; task.status = UploadStatus.cancelled; } await Workmanager().cancelAll();