Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions modules/ensemble/lib/framework/data_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,14 @@ class EnsembleStorage with Invokable {
void clear() {
final keys =
ensembleStorageClearDispatchKeys(StorageManager().getKeys());
StorageManager().clearPublicStorage();
for (final key in keys) {
ScreenController().dispatchStorageChanges(context, key, null);
}
// clearPublicStorage is async; binding listeners re-evaluate by reading
// GetStorage. Dispatch only after removal completes so eval() does not
// observe stale persisted values (see PR discussion on #2227).
unawaited(StorageManager().clearPublicStorage().whenComplete(() {
for (final key in keys) {
ScreenController().dispatchStorageChanges(context, key, null);
}
}));
}

@override
Expand Down
Loading