Project: appceleratorstudio
Issue TISTUD-6951: Studio: FSA sample when imported sometimes fails to enable ACS service because GUID already exists
h5. Description: While testing Field Service App (FSA) I repeatedly imported the sample, got it running, and then ran on simulator. For 3 runs, two failed service enablement (one test service, one cloud) on the initial creation attempt to enable services. Enabling after creation works. According to Praveen this is due to the service enablement timing conflicting with the task of changing the default GUID to a unique one, which happens for imported samples. If the service enablement occurs too quickly (before the unique GUID is generated), then the service enablement will fail. This does not seem to be a regression, as the process has not changed. But it is intermittent. Studio log shows the following when failure occurs: {code} !ENTRY com.appcelerator.titanium.360.core 4 0 2014-09-24 13:48:04.475 !MESSAGE (Build 3.4.0.201409231834) [ERROR] {"message":"Failed to create app: app with guid 'f4d35fcf-e8ca-4e70-a43c-959ca3dd7f07' already exists."} !STACK 1 org.eclipse.core.runtime.CoreException: {"message":"Failed to create app: app with guid 'f4d35fcf-e8ca-4e70-a43c-959ca3dd7f07' already exists."} com.appcelerator.titanium360.internal.core.Titanium360Manager.handleResponse(Titanium360Manager.java:439) com.appcelerator.titanium360.internal.core.Titanium360Manager.callAPI(Titanium360Manager.java:360) com.appcelerator.titanium360.internal.core.ThreeSixtyProject.getACSKeys(ThreeSixtyProject.java:849) com.appcelerator.titanium360.core.services.ACS360Service.installService(ACS360Service.java:74) com.appcelerator.titanium360.ui.util.Titanium360ProjectUtil.installService(Titanium360ProjectUtil.java:177) com.appcelerator.titanium360.ui.util.Titanium360ProjectUtil.installServices(Titanium360ProjectUtil.java:87) com.appcelerator.titanium360.ui.util.Titanium360ProjectUtil$2.runInWorkspace(Titanium360ProjectUtil.java:313) org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) org.eclipse.core.internal.jobs.Worker.run(Worker.java:53) !SUBENTRY 1 com.appcelerator.titanium.360.core 4 400 2014-09-24 13:48:04.475 !MESSAGE {"message":"Failed to create app: app with guid 'f4d35fcf-e8ca-4e70-a43c-959ca3dd7f07' already exists."} {code} h5. Steps to reproduce: 1) Import the FSA sample 2) Watch for service enablement to fail during the import process If no failure, delete the FSA with "remove from disk" option checked and try again. h5. Result: Log records failure, tiapp.xml editor shows failure to enable service h5. Expected Result: Service enabled correctly, with the appropriate GUID
Story points: 5