@@ -290,6 +290,11 @@ The next upload iteration will be delayed.`);
290290
291291 checkedCrudItem = nextCrudItem ;
292292 await this . options . uploadCrud ( ) ;
293+ this . updateSyncStatus ( {
294+ dataFlow : {
295+ uploadError : undefined
296+ }
297+ } ) ;
293298 } else {
294299 // Uploading is completed
295300 await this . options . adapter . updateLocalTarget ( ( ) => this . getWriteCheckpoint ( ) ) ;
@@ -299,7 +304,8 @@ The next upload iteration will be delayed.`);
299304 checkedCrudItem = undefined ;
300305 this . updateSyncStatus ( {
301306 dataFlow : {
302- uploading : false
307+ uploading : false ,
308+ uploadError : ex
303309 }
304310 } ) ;
305311 await this . delayRetry ( ) ;
@@ -453,6 +459,12 @@ The next upload iteration will be delayed.`);
453459 this . logger . error ( ex ) ;
454460 }
455461
462+ this . updateSyncStatus ( {
463+ dataFlow : {
464+ downloadError : ex
465+ }
466+ } ) ;
467+
456468 // On error, wait a little before retrying
457469 await this . delayRetry ( ) ;
458470 } finally {
@@ -588,7 +600,8 @@ The next upload iteration will be delayed.`);
588600 connected : true ,
589601 lastSyncedAt : new Date ( ) ,
590602 dataFlow : {
591- downloading : false
603+ downloading : false ,
604+ downloadError : undefined
592605 }
593606 } ) ;
594607 }
@@ -688,7 +701,10 @@ The next upload iteration will be delayed.`);
688701 this . updateSyncStatus ( {
689702 connected : true ,
690703 lastSyncedAt : new Date ( ) ,
691- priorityStatusEntries : [ ]
704+ priorityStatusEntries : [ ] ,
705+ dataFlow : {
706+ downloadError : undefined
707+ }
692708 } ) ;
693709 } else if ( validatedCheckpoint === targetCheckpoint ) {
694710 const result = await this . options . adapter . syncLocalDatabase ( targetCheckpoint ! ) ;
@@ -707,7 +723,8 @@ The next upload iteration will be delayed.`);
707723 lastSyncedAt : new Date ( ) ,
708724 priorityStatusEntries : [ ] ,
709725 dataFlow : {
710- downloading : false
726+ downloading : false ,
727+ downloadError : undefined
711728 }
712729 } ) ;
713730 }
0 commit comments