diff --git a/CHANGELOG.md b/CHANGELOG.md index d0a86bf..7a7ec97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.11] - 2026-01-04 + +### Fixed +- API client providers now use `keepAlive: true` to prevent Ref invalidation + - Fixes "DioException [unknown]: null" error on /security/users and other API pages + - AuthInterceptor's stored Ref was becoming invalid when provider auto-disposed + ## [1.1.10] - 2026-01-04 ### Changed diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 6ee647f..1c76837 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -9,7 +9,10 @@ import 'api_client_native.dart' if (dart.library.html) 'api_client_web.dart' part 'api_client.g.dart'; /// Provides the Dio instance for Core API. -@riverpod +/// +/// Uses keepAlive to prevent auto-dispose - the AuthInterceptor stores +/// a Ref that must remain valid for the lifetime of API requests. +@Riverpod(keepAlive: true) Dio coreApiClient(Ref ref) { final options = BaseOptions( baseUrl: AppConfig.coreApiUrl, @@ -33,7 +36,10 @@ Dio coreApiClient(Ref ref) { } /// Provides the Dio instance for Tatlock API. -@riverpod +/// +/// Uses keepAlive to prevent auto-dispose - the AuthInterceptor stores +/// a Ref that must remain valid for the lifetime of API requests. +@Riverpod(keepAlive: true) Dio tatlockApiClient(Ref ref) { final options = BaseOptions( baseUrl: AppConfig.tatlockApiUrl, diff --git a/pubspec.yaml b/pubspec.yaml index 8b414a0..13b19a7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.1.10+1 +version: 1.1.11+1 environment: sdk: ^3.10.4