fix: process upload only after successful remote sync (#22360)

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong
2025-09-29 20:40:00 +05:30
committed by GitHub
parent fea5e6783c
commit ee3c07d049
14 changed files with 156 additions and 73 deletions

View File

@@ -32,6 +32,7 @@ Cancelable<T?> runInIsolateGentle<T>({
}
return workerManager.executeGentle((cancelledChecker) async {
T? result;
await runZonedGuarded(
() async {
BackgroundIsolateBinaryMessenger.ensureInitialized(token);
@@ -53,7 +54,7 @@ Cancelable<T?> runInIsolateGentle<T>({
try {
HttpSSLOptions.apply(applyNative: false);
return await computation(ref);
result = await computation(ref);
} on CanceledError {
log.warning("Computation cancelled ${debugLabel == null ? '' : ' for $debugLabel'}");
} catch (error, stack) {
@@ -83,12 +84,11 @@ Cancelable<T?> runInIsolateGentle<T>({
await Future.delayed(const Duration(seconds: 2));
}
}
return null;
},
(error, stack) {
dPrint(() => "Error in isolate $debugLabel zone: $error, $stack");
},
);
return null;
return result;
});
}