Skip to content

Commit

Permalink
Adding comment about fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelGHSeg committed Aug 13, 2024
1 parent 596dcff commit 4c7b470
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/lib/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ abstract class PersistedState<T> implements AsyncStateNotifier<T> {
try {
rawV = await _store.getPersisted(_key);
} on FormatException catch (e) {
// Addressing https://github.com/segmentio/analytics_flutter/issues/74
// File corruption should be less likely with removal of async code in writes
// Existing corrupted files are cleaned up here without failing initialization
_store.setPersisted(_key, {});
log("Clean file $_key with format error", kind: LogFilterKind.warning);
final wrappedError = ErrorLoadingStorage(e);
Expand Down

0 comments on commit 4c7b470

Please sign in to comment.