@@ -100,8 +100,14 @@ class BackgroundSyncManager {
100100 // We use a ternary operator to avoid [_deviceAlbumSyncTask] from being
101101 // captured by the closure passed to [runInIsolateGentle].
102102 _deviceAlbumSyncTask = full
103- ? runInIsolateGentle (computation: (ref) => ref.read (localSyncServiceProvider).sync (full: true ))
104- : runInIsolateGentle (computation: (ref) => ref.read (localSyncServiceProvider).sync (full: false ));
103+ ? runInIsolateGentle (
104+ computation: (ref) => ref.read (localSyncServiceProvider).sync (full: true ),
105+ debugLabel: 'local-sync-full-true' ,
106+ )
107+ : runInIsolateGentle (
108+ computation: (ref) => ref.read (localSyncServiceProvider).sync (full: false ),
109+ debugLabel: 'local-sync-full-false' ,
110+ );
105111
106112 return _deviceAlbumSyncTask!
107113 .whenComplete (() {
@@ -122,7 +128,10 @@ class BackgroundSyncManager {
122128
123129 onHashingStart? .call ();
124130
125- _hashTask = runInIsolateGentle (computation: (ref) => ref.read (hashServiceProvider).hashAssets ());
131+ _hashTask = runInIsolateGentle (
132+ computation: (ref) => ref.read (hashServiceProvider).hashAssets (),
133+ debugLabel: 'hash-assets' ,
134+ );
126135
127136 return _hashTask!
128137 .whenComplete (() {
@@ -142,7 +151,10 @@ class BackgroundSyncManager {
142151
143152 onRemoteSyncStart? .call ();
144153
145- _syncTask = runInIsolateGentle (computation: (ref) => ref.read (syncStreamServiceProvider).sync ());
154+ _syncTask = runInIsolateGentle (
155+ computation: (ref) => ref.read (syncStreamServiceProvider).sync (),
156+ debugLabel: 'remote-sync' ,
157+ );
146158 return _syncTask!
147159 .whenComplete (() {
148160 onRemoteSyncComplete? .call ();
@@ -169,7 +181,7 @@ class BackgroundSyncManager {
169181 return _linkedAlbumSyncTask! .future;
170182 }
171183
172- _linkedAlbumSyncTask = runInIsolateGentle (computation: syncLinkedAlbumsIsolated);
184+ _linkedAlbumSyncTask = runInIsolateGentle (computation: syncLinkedAlbumsIsolated, debugLabel : 'linked-album-sync' );
173185 return _linkedAlbumSyncTask! .whenComplete (() {
174186 _linkedAlbumSyncTask = null ;
175187 });
@@ -178,4 +190,5 @@ class BackgroundSyncManager {
178190
179191Cancelable <void > _handleWsAssetUploadReadyV1Batch (List <dynamic > batchData) => runInIsolateGentle (
180192 computation: (ref) => ref.read (syncStreamServiceProvider).handleWsAssetUploadReadyV1Batch (batchData),
193+ debugLabel: 'websocket-batch' ,
181194);
0 commit comments