Skip to content

Commit

Permalink
Fixed missing cache keys when loading profile page on first install (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
DylanApardian and DylanApardian authored Apr 12, 2024
1 parent 91a82a4 commit 81e5509
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions lib/core/managers/course_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.");
}
}

Expand Down Expand Up @@ -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!;
Expand All @@ -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.");
}
}

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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.");
}
}

Expand Down Expand Up @@ -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!;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/core/managers/user_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProfileStudent> getInfo({bool fromCacheOnly = false}) async {
Future<ProfileStudent?> getInfo({bool fromCacheOnly = false}) async {
// Force fromCacheOnly mode when user has no connectivity
if (!(await _networkingService.hasConnectivity())) {
// ignore: parameter_assignments
Expand All @@ -280,7 +280,7 @@ class UserRepository {
}

if (fromCacheOnly) {
return _info!;
return _info;
}

try {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 81e5509

Please sign in to comment.