• Lau Ching Jun's avatar
    Fixed race condition in PollingDeviceDiscovery. (#145506) · c759c22e
    Lau Ching Jun authored
    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`.
    c759c22e
Name
Last commit
Last update
..
code_signing_test.dart Loading commit data...
core_devices_test.dart Loading commit data...
devices_test.dart Loading commit data...
ios_deploy_test.dart Loading commit data...
ios_device_install_test.dart Loading commit data...
ios_device_logger_test.dart Loading commit data...
ios_device_port_forwarder_test.dart Loading commit data...
ios_device_project_test.dart Loading commit data...
ios_device_start_nonprebuilt_test.dart Loading commit data...
ios_device_start_prebuilt_test.dart Loading commit data...
ios_project_migration_test.dart Loading commit data...
ios_workflow_test.dart Loading commit data...
mac_test.dart Loading commit data...
simulators_test.dart Loading commit data...
xcode_debug_test.dart Loading commit data...
xcodeproj_test.dart Loading commit data...
xcresult_test.dart Loading commit data...
xcresult_test_data.dart Loading commit data...