refreshFileSyncStatus method

Future<void> refreshFileSyncStatus()

Refreshes the file synchronization status from the server.

Updates the local cache of file sync status to reflect the current state of pending uploads and sync progress.

Usage:

try {
  await communicator.refreshFileSyncStatus();
  print('File sync status refreshed');

  // Now get updated pending files info
  final pendingCount = await communicator.getPendingFilesCount();
  final pendingSize = await communicator.getPendingFilesSize();
} catch (e) {
  print('Failed to refresh sync status: $e');
}

Throws:

  • Future.error("Unable to refresh file sync status"): When refresh fails

Use Cases:

  • Updating sync progress indicators
  • Checking sync status before important operations
  • Refreshing UI displays of sync progress

Implementation

Future<void> refreshFileSyncStatus() async {
  try {
    await kruzr_comm.refreshFileSyncStatus();
  } on Exception catch (e, stackTrace) {
    if (kDebugMode) {
      print("Error in refreshFileSyncStatus");
      print(stackTrace);
      print(e);
    }
    return Future.error("Unable to refresh file sync status");
  }
}