From 54117f4f772feb4a18b5e76e3219c66ef69e538a Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 4 Dec 2025 14:26:41 -0500 Subject: [PATCH] fix: fix type issue with keys in practice selection repo --- .../practice_activities/practice_selection_repo.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/pangea/practice_activities/practice_selection_repo.dart b/lib/pangea/practice_activities/practice_selection_repo.dart index ff7c5287f..d4165a61a 100644 --- a/lib/pangea/practice_activities/practice_selection_repo.dart +++ b/lib/pangea/practice_activities/practice_selection_repo.dart @@ -77,17 +77,19 @@ class PracticeSelectionRepo { static PracticeSelection? _getCached( String eventId, ) { - for (final String key in _storage.getKeys()) { - try { + try { + final keys = List.from(_storage.getKeys()); + for (final String key in keys) { final cacheEntry = _PracticeSelectionCacheEntry.fromJson( _storage.read(key), ); if (cacheEntry.isExpired) { _storage.remove(key); } - } catch (e) { - _storage.remove(key); } + } catch (e) { + _storage.erase(); + return null; } final entry = _storage.read(eventId);