fix: ios skip posting hash response after detached from engine (#22695)

* skip posting message after detached from engine

* review changes

* cancel plugin before destroying engine

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
shenlong 2025-10-14 07:39:12 +05:30 committed by GitHub
parent 46869f664d
commit cf52b879b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 62 additions and 15 deletions

View file

@ -192,6 +192,7 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
_cancellationToken.cancel();
_logger.info("Cleaning up background worker");
final cleanupFutures = [
nativeSyncApi?.cancelHashing(),
workerManager.dispose().catchError((_) async {
// Discard any errors on the dispose call
return;
@ -201,7 +202,6 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
_drift.close(),
_driftLogger.close(),
backgroundSyncManager?.cancel(),
nativeSyncApi?.cancelHashing(),
];
if (_isar.isOpen) {