• 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
..
migrations Loading commit data...
application_package.dart Loading commit data...
code_signing.dart Loading commit data...
core_devices.dart Loading commit data...
devices.dart Loading commit data...
ios_deploy.dart Loading commit data...
ios_emulators.dart Loading commit data...
ios_workflow.dart Loading commit data...
iproxy.dart Loading commit data...
mac.dart Loading commit data...
plist_parser.dart Loading commit data...
simulators.dart Loading commit data...
xcode_build_settings.dart Loading commit data...
xcode_debug.dart Loading commit data...
xcodeproj.dart Loading commit data...
xcresult.dart Loading commit data...