call method
Implementation
Future<TransactionResult> call(
String reducerName,
Uint8List args, {
Duration? timeout,
bool dropIfOffline = false,
List<OptimisticChange>? optimisticChanges,
}) async {
if (dropIfOffline && !_isOnline) {
return TransactionResult.dropped(reducerName: reducerName);
}
if (dropIfOffline) {
return _sendDirectly(reducerName, args, timeout, optimisticChanges);
}
SdkLogger.d(
'$reducerName: state=${_connection.state.displayName}, isOnline=$_isOnline, hasOfflineStorage=${_offlineStorage != null}',
);
if (_offlineStorage != null) {
SdkLogger.d('OFFLINE-FIRST: Always queue first, then sync');
return _queueAndMaybeSync(reducerName, args, optimisticChanges);
}
SdkLogger.d('NO OFFLINE STORAGE: Direct send (legacy path)');
return _sendDirectly(reducerName, args, timeout, optimisticChanges);
}