syncBatch method
Syncs a batch of tasks to the server.
The server must explicitly confirm which taskIds succeeded by returning them in SyncResult.successTaskIds.
Tasks that failed should be returned in SyncResult.failedTaskErrors with their corresponding error messages.
This method should handle network errors gracefully and return appropriate error information in the result.
Implementation
@override
Future<SyncResult> syncBatch(List<SyncTask> tasks) async {
batches.add(tasks.map((t) => t.copyWith()).toList());
if (latency > Duration.zero) await Future<void>.delayed(latency);
final next = _script.isNotEmpty ? _script.removeAt(0) : handler;
return next(tasks);
}