From 605f533f9b3e1487ad705a3a8cf15dd4da72c47c Mon Sep 17 00:00:00 2001 From: provokateurin Date: Wed, 9 Oct 2024 10:16:50 +0200 Subject: [PATCH] feat(neon_framework): Allow getting http.Request async in RequestManager Signed-off-by: provokateurin --- packages/neon_framework/lib/src/utils/request_manager.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ...',