From 81e55096118f795deb61a6bd0c821e4f293a52cb Mon Sep 17 00:00:00 2001 From: DylanApardian <155918717+DylanApardian@users.noreply.github.com> Date: Fri, 12 Apr 2024 18:54:27 -0400 Subject: [PATCH] Fixed missing cache keys when loading profile page on first install (#967) * Fixed missing cache keys when loading profile page on first install * [BOT] Applying version. * Fixed spelling mistakes * Applied suggested fix * Reverted change * [BOT] Applying version. --------- Co-authored-by: DylanApardian --- lib/core/managers/course_repository.dart | 22 +++++++++++----------- lib/core/managers/user_repository.dart | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/core/managers/course_repository.dart b/lib/core/managers/course_repository.dart index 373245aac..66455f813 100644 --- a/lib/core/managers/course_repository.dart +++ b/lib/core/managers/course_repository.dart @@ -121,7 +121,7 @@ class CourseRepository { "$tag - getCoursesActivities: ${_coursesActivities?.length ?? 0} activities loaded from cache"); } on CacheException catch (_) { _logger.e( - "$tag - getCoursesActivities: exception raised will trying to load activities from cache."); + "$tag - getCoursesActivities: exception raised while trying to load activities from cache."); } } @@ -181,7 +181,7 @@ class CourseRepository { } on CacheException catch (_) { // Do nothing, the caching will retry later and the error has been logged by the [CacheManager] _logger.e( - "$tag - getCoursesActivities: exception raised will trying to update the cache."); + "$tag - getCoursesActivities: exception raised while trying to update the cache."); } return _coursesActivities; @@ -220,7 +220,7 @@ class CourseRepository { "$tag - getScheduleDefaultActivities: ${_scheduleDefaultActivities.length} activities loaded from cache"); } on CacheException catch (_) { _logger.e( - "$tag - getDefaultScheduleActivities: exception raised will trying to load activities from cache."); + "$tag - getDefaultScheduleActivities: exception raised while trying to load activities from cache."); } if (fromCacheOnly) { @@ -254,7 +254,7 @@ class CourseRepository { } on CacheException catch (_) { // Do nothing, the caching will retry later and the error has been logged by the [CacheManager] _logger.e( - "$tag - getScheduleActivities: exception raised will trying to update the cache."); + "$tag - getScheduleActivities: exception raised while trying to update the cache."); } return _scheduleDefaultActivities; @@ -287,7 +287,7 @@ class CourseRepository { "$tag - getScheduleActivities: ${_scheduleActivities!.length} activities loaded from cache"); } on CacheException catch (_) { _logger.e( - "$tag - getScheduleActivities: exception raised will trying to load activities from cache."); + "$tag - getScheduleActivities: exception raised while trying to load activities from cache."); } } @@ -338,7 +338,7 @@ class CourseRepository { } on CacheException catch (_) { // Do nothing, the caching will retry later and the error has been logged by the [CacheManager] _logger.e( - "$tag - getScheduleActivities: exception raised will trying to update the cache."); + "$tag - getScheduleActivities: exception raised while trying to update the cache."); } return _scheduleActivities!; @@ -363,7 +363,7 @@ class CourseRepository { "$tag - getSessions: ${_sessions?.length ?? 0} sessions loaded from cache."); } on CacheException catch (_) { _logger.e( - "$tag - getSessions: exception raised will trying to load the sessions from cache."); + "$tag - getSessions: exception raised while trying to load the sessions from cache."); } } @@ -394,7 +394,7 @@ class CourseRepository { } } on CacheException catch (_) { _logger.e( - "$tag - getSessions: exception raised will trying to update the cache."); + "$tag - getSessions: exception raised while trying to update the cache."); return _sessions!; } on Exception catch (e, stacktrace) { _analyticsService.logError( @@ -430,7 +430,7 @@ class CourseRepository { "$tag - getCourses: ${_courses!.length} courses loaded from cache"); } on CacheException catch (_) { _logger.e( - "$tag - getCourses: exception raised will trying to load courses from cache."); + "$tag - getCourses: exception raised while trying to load courses from cache."); } } @@ -490,7 +490,7 @@ class CourseRepository { } on CacheException catch (_) { // Do nothing, the caching will retry later and the error has been logged by the [CacheManager] _logger.e( - "$tag - getCourses: exception raised will trying to update the cache."); + "$tag - getCourses: exception raised while trying to update the cache."); } return _courses!; @@ -548,7 +548,7 @@ class CourseRepository { // Do nothing, the caching will retry later and // the error has been logged by the [CacheManager] _logger.e( - "$tag - getCourseSummary: exception raised will trying to update the cache."); + "$tag - getCourseSummary: exception raised while trying to update the cache."); } return course; diff --git a/lib/core/managers/user_repository.dart b/lib/core/managers/user_repository.dart index 71feb98be..043313f1c 100644 --- a/lib/core/managers/user_repository.dart +++ b/lib/core/managers/user_repository.dart @@ -256,7 +256,7 @@ class UserRepository { /// Get the profile information. /// The information from the [CacheManager] is loaded than updated with the results /// from the [SignetsApi]. - Future getInfo({bool fromCacheOnly = false}) async { + Future getInfo({bool fromCacheOnly = false}) async { // Force fromCacheOnly mode when user has no connectivity if (!(await _networkingService.hasConnectivity())) { // ignore: parameter_assignments @@ -280,7 +280,7 @@ class UserRepository { } if (fromCacheOnly) { - return _info!; + return _info; } try { diff --git a/pubspec.yaml b/pubspec.yaml index d50733c98..0d3ca24b6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ description: The 4th generation of ÉTSMobile, the main gateway between the Éco # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 4.38.1+1 +version: 4.38.2+1 environment: sdk: ">=3.3.0 <4.0.0"