flutter/packages
Lau Ching Jun c759c22e71
Fixed race condition in PollingDeviceDiscovery. (#145506)
There are two issues in the previous implementation:
1. `_populateDevices` will return the devices from `deviceNotifier` if it had been initialized, assuming that once it's initialized, it has been properly populated. That assumption is not true because calling getters like `onAdded` would initialize `deviceNotifier` without populating it.
2. `deviceNotifier` instance might be replaced in some cases, causing `onAdded` subscribers to lose any future updates.

To fix (1), this commit added the `isPopulated` field in `deviceNotifier` as a more accurate flag to determine if we need to populate it.

To fix (2), this commit made `deviceNotifier` a final member in `PolingDeviceDiscovery`.
2024-03-21 22:37:08 +00:00
..
flutter Clarify AutomaticKeepAliveClientMixin semantics in build method (#145297) 2024-03-21 21:28:07 +00:00
flutter_driver flutter test --wasm support (#145347) 2024-03-21 20:08:07 +00:00
flutter_goldens Roll pub packages (#145476) 2024-03-21 00:09:24 +00:00
flutter_localizations Roll pub packages (#145476) 2024-03-21 00:09:24 +00:00
flutter_test flutter test --wasm support (#145347) 2024-03-21 20:08:07 +00:00
flutter_tools Fixed race condition in PollingDeviceDiscovery. (#145506) 2024-03-21 22:37:08 +00:00
flutter_web_plugins Roll pub packages (#145476) 2024-03-21 00:09:24 +00:00
fuchsia_remote_debug_protocol Roll pub packages (#145476) 2024-03-21 00:09:24 +00:00
integration_test flutter test --wasm support (#145347) 2024-03-21 20:08:07 +00:00
analysis_options.yaml