diff --git a/packages/brick_offline_first_with_rest/lib/src/offline_first_with_rest_repository.dart b/packages/brick_offline_first_with_rest/lib/src/offline_first_with_rest_repository.dart index 287bb1fb..2f9d6fe1 100644 --- a/packages/brick_offline_first_with_rest/lib/src/offline_first_with_rest_repository.dart +++ b/packages/brick_offline_first_with_rest/lib/src/offline_first_with_rest_repository.dart @@ -34,7 +34,7 @@ abstract class OfflineFirstWithRestRepository /// which is present in the [reattemptForStatusCodes] list. /// /// Forwarded to [RestOfflineQueueClient]. - void Function(http.Request request, http.StreamedResponse response)? onReattemptableResponse; + void Function(http.Request request, int statusCode)? onReattemptableResponse; /// A callback triggered when a request throws an exception during execution. /// diff --git a/packages/brick_offline_first_with_rest/lib/src/offline_queue/rest_offline_queue_client.dart b/packages/brick_offline_first_with_rest/lib/src/offline_queue/rest_offline_queue_client.dart index 55f5b84b..202d4495 100644 --- a/packages/brick_offline_first_with_rest/lib/src/offline_queue/rest_offline_queue_client.dart +++ b/packages/brick_offline_first_with_rest/lib/src/offline_queue/rest_offline_queue_client.dart @@ -21,7 +21,7 @@ class RestOfflineQueueClient extends http.BaseClient { /// A callback triggered when the response of a request has a status code /// which is present in the [reattemptForStatusCodes] list. - void Function(http.Request request, http.StreamedResponse response)? onReattemptableResponse; + void Function(http.Request request, int statusCode)? onReattemptableResponse; /// A callback triggered when a request throws an exception during execution. /// @@ -110,7 +110,7 @@ class RestOfflineQueueClient extends http.BaseClient { _logger.finer( 'request failed, will be reattempted: ${cacheItem.toSqlite()}', ); - onReattemptableResponse?.call(request, resp); + onReattemptableResponse?.call(request, resp.statusCode); } } diff --git a/packages/brick_offline_first_with_supabase/lib/src/offline_first_with_supabase_repository.dart b/packages/brick_offline_first_with_supabase/lib/src/offline_first_with_supabase_repository.dart index 834a1c7c..d4549c6c 100644 --- a/packages/brick_offline_first_with_supabase/lib/src/offline_first_with_supabase_repository.dart +++ b/packages/brick_offline_first_with_supabase/lib/src/offline_first_with_supabase_repository.dart @@ -189,7 +189,7 @@ abstract class OfflineFirstWithSupabaseRepository 504, ], bool? serialProcessing, - void Function(http.Request request, http.StreamedResponse response)? onReattemptableResponse, + void Function(http.Request request, int statusCode)? onReattemptableResponse, void Function(http.Request, Object)? onRequestError, }) { final client = RestOfflineQueueClient(