fix(mobile): proper background task cleanup (#28694)

* event-based cancellation

wire hash cancellation

await cleanup

remove forced kill

add regression tests

abort sync requests

fix cleanup ordering in teardown

exit isolate

test background sync

test sigabrt crash

cleanup

* abort local sync
This commit is contained in:
Mert 2026-06-03 08:16:19 -04:00 committed by GitHub
parent 96d521e149
commit 963862b1b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 990 additions and 397 deletions

View file

@ -105,25 +105,26 @@ class CloudIdResult {
@HostApi()
abstract class NativeSyncApi {
@async
bool shouldFullSync();
@TaskQueue(type: TaskQueueType.serialBackgroundThread)
@async
SyncDelta getMediaChanges();
void checkpointSync();
void clearSyncCheckpoint();
@TaskQueue(type: TaskQueueType.serialBackgroundThread)
@async
List<String> getAssetIdsForAlbum(String albumId);
@TaskQueue(type: TaskQueueType.serialBackgroundThread)
@async
List<PlatformAlbum> getAlbums();
@TaskQueue(type: TaskQueueType.serialBackgroundThread)
int getAssetsCountSince(String albumId, int timestamp);
@TaskQueue(type: TaskQueueType.serialBackgroundThread)
@async
List<PlatformAsset> getAssetsForAlbum(String albumId, {int? updatedTimeCond});
@async
@ -132,6 +133,8 @@ abstract class NativeSyncApi {
void cancelHashing();
void cancelSync();
@TaskQueue(type: TaskQueueType.serialBackgroundThread)
Map<String, List<PlatformAsset>> getTrashedAssets();