Project: appceleratorstudio
Issue TISTUD-8011: Studio should rely on CLI to find updates 
With 5.1.2.GA, 5.2.0.RC and 6.0.0 nightly installed, Studio update says _Latest Titanium SDK already installed_ and does not install 5.2.0.GA. Renaming the 6.0.0 folder to 6.0.0.CI or the original 6.0.0.v20160110233608 does not fix it. Removing the folder does. I traced it back here, but can't really tell why it thinks 5.2.0.GA is already installed: https://github.com/appcelerator/titanium_studio/blob/bcb31abca5a44bddc7a962319d5b040b4d3610c0/plugins/com.appcelerator.titanium.update.core/src/com/appcelerator/titanium/update/internal/core/TitaniumReleasesUpdater.java#L841-L842 Looking at the code for [getSDKStableInstalledVersion|https://github.com/appcelerator/titanium_studio/blob/bcb31abca5a44bddc7a962319d5b040b4d3610c0/plugins/com.appcelerator.titanium.update.core/src/com/appcelerator/titanium/update/internal/core/TitaniumReleasesUpdater.java#L579] and [SDKReleaseGAFilter|https://github.com/appcelerator/titanium_studio/blob/938ba3b47c1ab33add316308e6593ee99cd329b6/plugins/com.appcelerator.titanium.core/src/com/appcelerator/titanium/core/mobile/SDKReleaseGAFilter.java] it should find 5.1.2.GA as my latest SDK. So then something must be wrong with [isHigherThanGA|https://github.com/appcelerator/titanium_studio/blob/bcb31abca5a44bddc7a962319d5b040b4d3610c0/plugins/com.appcelerator.titanium.update.core/src/com/appcelerator/titanium/update/internal/core/TitaniumReleasesUpdater.java#L830] which uses [DescendingStreamAwareVersionComparator|https://github.com/appcelerator/titanium_studio/blob/938ba3b47c1ab33add316308e6593ee99cd329b6/plugins/com.appcelerator.titanium.core/src/com/appcelerator/titanium/core/DescendingStreamAwareVersionComparator.java] Wherever the bug exactly is I think we can simplify and make this a lot more stable: * Don't duplicate this logic (including it's bugs: CLI-705) in CLI and Studio, but let Studio rely on CLI to find updates so we have only one point of failure. * Don't rely on the SDK release version name (for available releases) and folder name (for installed releases) to determine what is available and installed, but use the checksum or timestamp (TIMOB-19541, see {{appc ti sdk list}}) so the logic does not fail if people rename SDK folders (CLI-910). * Don't compare if the latest available release is newer then the latest one installed, but simply check if the latest available release IS installed. This removes all the points of failure in stuff like [DescendingStreamAwareVersionComparator|https://github.com/appcelerator/titanium_studio/blob/938ba3b47c1ab33add316308e6593ee99cd329b6/plugins/com.appcelerator.titanium.core/src/com/appcelerator/titanium/core/DescendingStreamAwareVersionComparator.java] Logs to help debug the current issue: {code} !ENTRY com.appcelerator.titanium.update.core 1 0 2016-02-23 09:01:13.106 !MESSAGE (Build 4.5.0.201602170821) [INFO] com.appcelerator.titanium.update.core/debug/sdk_update Retrieving the list of Titanium mobilesdk from URL: https://f4df0833a1352ef193633d85356e6e80ffcdcdb7.cloudapp-enterprise.appcelerator.com/api/mobilesdk/releases/25991779-01c4-41a6-a4d3-86107428797b !ENTRY com.appcelerator.titanium.update.core 1 0 2016-02-23 09:01:16.610 !MESSAGE (Build 4.5.0.201602170821) [INFO] com.appcelerator.titanium.update.core/debug/sdk_update Available Titanium mobilesdk: { "success": true, "releases": [ { "build_type": "64bit_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.2.0.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.2.0/mobilesdk-5.2.0.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "32bit_i386", "name": "mobilesdk", "guid": "1C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.2.0.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.2.0/mobilesdk-5.2.0.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "win32", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.2.0.GA", "os": "win32", "url": "http://builds.appcelerator.com/mobile-releases/5.2.0/mobilesdk-5.2.0.GA-win32.zip", "checksum": "779bfd4d226ba6d3162a069c50f3650ab42cd504", "children": null }, { "build_type": "10.5_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.2.0.GA", "os": "osx", "url": "http://builds.appcelerator.com/mobile-releases/5.2.0/mobilesdk-5.2.0.GA-osx.zip", "checksum": "7ff2e2485fbf745950ccc586d28a3483a413cb7e", "children": null }, { "build_type": "64bit_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.2.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.1.2/mobilesdk-5.1.2.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "32bit_i386", "name": "mobilesdk", "guid": "1C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.2.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.1.2/mobilesdk-5.1.2.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "win32", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.2.GA", "os": "win32", "url": "http://builds.appcelerator.com/mobile-releases/5.1.2/mobilesdk-5.1.2.GA-win32.zip", "checksum": "779bfd4d226ba6d3162a069c50f3650ab42cd504", "children": null }, { "build_type": "10.5_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.2.GA", "os": "osx", "url": "http://builds.appcelerator.com/mobile-releases/5.1.2/mobilesdk-5.1.2.GA-osx.zip", "checksum": "7ff2e2485fbf745950ccc586d28a3483a413cb7e", "children": null }, { "build_type": "64bit_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.1.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.1.1/mobilesdk-5.1.1.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "32bit_i386", "name": "mobilesdk", "guid": "1C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.1.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.1.1/mobilesdk-5.1.1.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "win32", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.1.GA", "os": "win32", "url": "http://builds.appcelerator.com/mobile-releases/5.1.1/mobilesdk-5.1.1.GA-win32.zip", "checksum": "779bfd4d226ba6d3162a069c50f3650ab42cd504", "children": null }, { "build_type": "10.5_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.1.GA", "os": "osx", "url": "http://builds.appcelerator.com/mobile-releases/5.1.1/mobilesdk-5.1.1.GA-osx.zip", "checksum": "7ff2e2485fbf745950ccc586d28a3483a413cb7e", "children": null }, { "build_type": "64bit_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.0.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.1.0/mobilesdk-5.1.0.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "32bit_i386", "name": "mobilesdk", "guid": "1C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.0.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.1.0/mobilesdk-5.1.0.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "win32", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.0.GA", "os": "win32", "url": "http://builds.appcelerator.com/mobile-releases/5.1.0/mobilesdk-5.1.0.GA-win32.zip", "checksum": "779bfd4d226ba6d3162a069c50f3650ab42cd504", "children": null }, { "build_type": "10.5_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.1.0.GA", "os": "osx", "url": "http://builds.appcelerator.com/mobile-releases/5.1.0/mobilesdk-5.1.0.GA-osx.zip", "checksum": "7ff2e2485fbf745950ccc586d28a3483a413cb7e", "children": null }, { "build_type": "64bit_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.2.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.0.2/mobilesdk-5.0.2.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "32bit_i386", "name": "mobilesdk", "guid": "1C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.2.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.0.2/mobilesdk-5.0.2.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "win32", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.2.GA", "os": "win32", "url": "http://builds.appcelerator.com/mobile-releases/5.0.2/mobilesdk-5.0.2.GA-win32.zip", "checksum": "779bfd4d226ba6d3162a069c50f3650ab42cd504", "children": null }, { "build_type": "10.5_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.2.GA", "os": "osx", "url": "http://builds.appcelerator.com/mobile-releases/5.0.2/mobilesdk-5.0.2.GA-osx.zip", "checksum": "7ff2e2485fbf745950ccc586d28a3483a413cb7e", "children": null }, { "build_type": "64bit_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.1.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.0.1/mobilesdk-5.0.1.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "32bit_i386", "name": "mobilesdk", "guid": "1C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.1.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.0.1/mobilesdk-5.0.1.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "win32", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.1.GA", "os": "win32", "url": "http://builds.appcelerator.com/mobile-releases/5.0.1/mobilesdk-5.0.1.GA-win32.zip", "checksum": "779bfd4d226ba6d3162a069c50f3650ab42cd504", "children": null }, { "build_type": "10.5_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.1.GA", "os": "osx", "url": "http://builds.appcelerator.com/mobile-releases/5.0.1/mobilesdk-5.0.1.GA-osx.zip", "checksum": "7ff2e2485fbf745950ccc586d28a3483a413cb7e", "children": null }, { "build_type": "64bit_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.0.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.0.0/mobilesdk-5.0.0.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "32bit_i386", "name": "mobilesdk", "guid": "1C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.0.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/5.0.0/mobilesdk-5.0.0.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "win32", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.0.GA", "os": "win32", "url": "http://builds.appcelerator.com/mobile-releases/5.0.0/mobilesdk-5.0.0.GA-win32.zip", "checksum": "779bfd4d226ba6d3162a069c50f3650ab42cd504", "children": null }, { "build_type": "10.5_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "5.0.0.GA", "os": "osx", "url": "http://builds.appcelerator.com/mobile-releases/5.0.0/mobilesdk-5.0.0.GA-osx.zip", "checksum": "7ff2e2485fbf745950ccc586d28a3483a413cb7e", "children": null }, { "build_type": "64bit_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.1.1.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/4.1.1/mobilesdk-4.1.1.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "32bit_i386", "name": "mobilesdk", "guid": "1C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.1.1.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/4.1.1/mobilesdk-4.1.1.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "win32", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.1.1.GA", "os": "win32", "url": "http://builds.appcelerator.com/mobile-releases/4.1.1/mobilesdk-4.1.1.GA-win32.zip", "checksum": "779bfd4d226ba6d3162a069c50f3650ab42cd504", "children": null }, { "build_type": "10.5_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.1.1.GA", "os": "osx", "url": "http://builds.appcelerator.com/mobile-releases/4.1.1/mobilesdk-4.1.1.GA-osx.zip", "checksum": "7ff2e2485fbf745950ccc586d28a3483a413cb7e", "children": null }, { "build_type": "64bit_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.1.0.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/4.1.0/mobilesdk-4.1.0.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "32bit_i386", "name": "mobilesdk", "guid": "1C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.1.0.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile-releases/4.1.0/mobilesdk-4.1.0.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "win32", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.1.0.GA", "os": "win32", "url": "http://builds.appcelerator.com/mobile-releases/4.1.0/mobilesdk-4.1.0.GA-win32.zip", "checksum": "779bfd4d226ba6d3162a069c50f3650ab42cd504", "children": null }, { "build_type": "10.5_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.1.0.GA", "os": "osx", "url": "http://builds.appcelerator.com/mobile-releases/4.1.0/mobilesdk-4.1.0.GA-osx.zip", "checksum": "7ff2e2485fbf745950ccc586d28a3483a413cb7e", "children": null }, { "build_type": "64bit_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.0.0.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile/4.0.0/mobilesdk-4.0.0.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "32bit_i386", "name": "mobilesdk", "guid": "1C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.0.0.GA", "os": "linux", "url": "http://builds.appcelerator.com/mobile/4.0.0/mobilesdk-4.0.0.GA-linux.zip", "checksum": "db95eff99c6e137bb53c5fb4386380a263844f55", "children": null }, { "build_type": "win32", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "version": "4.0.0.GA", "os": "win32", "url": "http://builds.appcelerator.com/mobile/4.0.0/mobilesdk-4.0.0.GA-win32.zip", "checksum": "779bfd4d226ba6d3162a069c50f3650ab42cd504", "children": null }, { "build_type": "10.5_i386", "name": "mobilesdk", "guid": "C5A13520-E091-4CEA-BFC3-AE453D23238D", "versio...
Story points: 5