diff --git a/packages/neon_framework/lib/src/utils/request_manager.dart b/packages/neon_framework/lib/src/utils/request_manager.dart index e39e7101fe5..422fef31479 100644 --- a/packages/neon_framework/lib/src/utils/request_manager.dart +++ b/packages/neon_framework/lib/src/utils/request_manager.dart @@ -71,7 +71,7 @@ class RequestManager { Future wrap({ required Account account, required BehaviorSubject> subject, - required http.Request Function() getRequest, + required FutureOr Function() getRequest, required Converter converter, required UnwrapCallback unwrap, AsyncValueGetter>? getCacheHeaders, @@ -83,7 +83,7 @@ class RequestManager { subject.add(Result.loading()); } - var request = getRequest(); + var request = await getRequest(); final cachedResponse = await _cache?.get(account, request); if (subject.isClosed) { @@ -216,7 +216,7 @@ class RequestManager { break; } - request = getRequest(); + request = await getRequest(); _log.info( 'Error while executing the request. Retrying ...',