fix: not clearing local data when logging out while sync is running (#20646)

This commit is contained in:
Brandon Wees 2025-08-04 17:14:26 -05:00 committed by GitHub
parent 094e3a2757
commit 4d0c9172e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -37,7 +37,7 @@ class BackgroundSyncManager {
this.onHashingError,
});
Future<void> cancel() {
Future<void> cancel() async {
final futures = <Future>[];
if (_syncTask != null) {
@ -52,7 +52,11 @@ class BackgroundSyncManager {
_syncWebsocketTask?.cancel();
_syncWebsocketTask = null;
return Future.wait(futures);
try {
await Future.wait(futures);
} on CanceledError {
// Ignore cancellation errors
}
}
// No need to cancel the task, as it can also be run when the user logs out

View File

@ -83,7 +83,6 @@ Future<void> initApp() async {
};
PlatformDispatcher.instance.onError = (error, stack) {
debugPrint("FlutterError - Catch all: $error \n $stack");
log.severe('PlatformDispatcher - Catch all', error, stack);
return true;
};