• 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
..
analyze_size.dart Loading commit data...
async_guard.dart Loading commit data...
bot_detector.dart Loading commit data...
build.dart Loading commit data...
command_help.dart Loading commit data...
common.dart Loading commit data...
config.dart Loading commit data...
context.dart Loading commit data...
dds.dart Loading commit data...
deferred_component.dart Loading commit data...
error_handling_io.dart Loading commit data...
file_system.dart Loading commit data...
fingerprint.dart Loading commit data...
io.dart Loading commit data...
logger.dart Loading commit data...
multi_root_file_system.dart Loading commit data...
net.dart Loading commit data...
os.dart Loading commit data...
platform.dart Loading commit data...
process.dart Loading commit data...
project_migrator.dart Loading commit data...
signals.dart Loading commit data...
task_queue.dart Loading commit data...
template.dart Loading commit data...
terminal.dart Loading commit data...
time.dart Loading commit data...
user_messages.dart Loading commit data...
utils.dart Loading commit data...
version.dart Loading commit data...
version_range.dart Loading commit data...