Titanium JIRA Archive
Appcelerator Daemon (DAEMON)

[DAEMON-252] Android: Daemon does not detect addition/deletion of genymotion emulator's immediately

GitHub Issuen/a
TypeBug
PriorityHigh
StatusResolved
ResolutionFixed
Resolution Date2019-04-01T06:31:45.000+0000
Affected Version/sAppc Daemon 1.1.0, Appc Daemon 1.0.1
Fix Version/sAppc Daemon 2.3.0
Componentsappcd, appcd-plugin-genymotion
Labelsn/a
ReporterLokesh Choudhary
AssigneeChris Barber
Created2018-04-12T20:17:21.000+0000
Updated2019-04-01T06:31:45.000+0000

Description

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.

Comments

  1. 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
  2. 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
  3. 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-android currently watches the VirtualBox.xml for 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-android only detects new VMs, deleted VMs, and renamed VMs. It does not detect property changes such as DPI changes. @appcd/plugin-genymotion does. It seems silly to copy the logic from @appcd/plugin-genymotion to @appcd/plugin-android, but it's completely valid for @appcd/plugin-android to depend on @appcd/plugin-genymotion. The proper fix for this ticket would be to remove the fs watching of VirtualBox.xml and subscribe to /genymotion/1.x/info/emulators and use that event to trigger re-detection, which will be cached anyways in androidlib. Note that @appcd/plugin-android needs to properly handle a 404 from /genymotion should something go wrong, which it shouldn't. 2. @appcd/plugin-android does unnecessary unsubscribe/resubscribe causing events to slip through the cracks. This is what DAEMON-253 aims to fix.
  4. Chris Barber 2019-04-01

    Fixed by https://github.com/appcelerator/appc-daemon-plugins/pull/4.

JSON Source