[DAEMON-252] Android: Daemon does not detect addition/deletion of genymotion emulator's immediately
|Appc Daemon 1.1.0, Appc Daemon 1.0.1
|Appc Daemon 2.3.0
Does not appear to be a regression. Seen in 1.0.1 as well.
Steps to reproduce:1. Add a 2-3 genymotion emulator in the genymotion app. 2. Run
appc appcd exec /android/latest/info/emulators.
3. Repeat the steps after deleting 2-3 genymotion emulators.
Actual result:1. Appc daemon does not pick up the changes to genymotion immediately for both addition & deletion scenarios but, does after an
appc appcd restart.
Expected results:1. Appc daemon should pickup the changes immediately.
- Ewan Harris 2018-04-13
This is maybe a dupe of DAEMON-249, reviewing the code of the plugin the changes never got published due to a linting issue (fixed in https://github.com/appcelerator/appcd-plugin-android/pull/12) I will publish 1.1.1 soon
- Chris Barber 2018-04-13
I believe the root of the problem is a race condition. Whenever the VM's config is changed (about 9 times), the code would constantly watch and unwatch the same paths over and over again. This mechanically worked, but I believe pending fs events were never being delivered. Changing the the code to track by path->subscription-id instead of subscription-id->path allows quicker checks to see if the path is already being watched. Note that the Android and iOS plugins will likely suffer from the same problem. I've created DAEMON-253 to investigate. https://github.com/appcelerator/appcd-plugin-genymotion/pull/8
- Chris Barber 2019-03-25
Update: I cannot reproduce this with the latest and greatest code, however there are still underlying issues to address: 1.
@appcd/plugin-androidcurrently watches the
VirtualBox.xmlfor changes, then redetects emulators. This does not take into account whether VirtualBox or Genymotion is installed, though this isn't a huge issue as it's only a small amount of wasted resources. The bigger problem
@appcd/plugin-androidonly detects new VMs, deleted VMs, and renamed VMs. It does not detect property changes such as DPI changes.
@appcd/plugin-genymotiondoes. It seems silly to copy the logic from
@appcd/plugin-android, but it's completely valid for
@appcd/plugin-androidto depend on
@appcd/plugin-genymotion. The proper fix for this ticket would be to remove the fs watching of
VirtualBox.xmland subscribe to
/genymotion/1.x/info/emulatorsand use that event to trigger re-detection, which will be cached anyways in
androidlib. Note that
@appcd/plugin-androidneeds to properly handle a 404 from
/genymotionshould something go wrong, which it shouldn't. 2.
@appcd/plugin-androiddoes unnecessary unsubscribe/resubscribe causing events to slip through the cracks. This is what DAEMON-253 aims to fix.
- Chris Barber 2019-04-01
Fixed by https://github.com/appcelerator/appc-daemon-plugins/pull/4.