Project: aptanastudio
Issue APSTUD-4650: Revisit the loading of samples from Rubles to prevent multiple reloads of the same content
It appears that the samples are being loaded twice from Rubles. I have my whole of samples list deleted (but then it's re-added). Turn on the relevant troubleshooting items and restart Studio to see the following log messages: {code} !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:42.008 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.kitchensink.ipad; name = Kitchen Sink iPad !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:42.010 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.kitchensink; name = Kitchen Sink !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:42.010 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.kitchensink.nook; name = Kitchen Sink Nook !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:42.011 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.rss; name = RSS Reader !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:42.011 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.mapping; name = Geocoder !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:42.011 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.todo; name = Todo List !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:48.830 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Removed all existing samples !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:48.835 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager adding the list of samples !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:48.835 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.mapping; name = Geocoder !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:48.835 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.rss; name = RSS Reader !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:48.836 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.todo; name = Todo List !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:48.837 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.kitchensink; name = Kitchen Sink !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:48.849 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.kitchensink.nook; name = Kitchen Sink Nook !ENTRY com.aptana.samples 1 0 2012-04-14 05:08:48.850 !MESSAGE (Build 3.0.0.qualifier) [INFO] com.aptana.samples/debug/manager Added sample: id = com.appcelerator.titanium.mobile.samples.kitchensink.ipad; name = Kitchen Sink iPad {code} I get a script loaded event for /Users/ingo/Documents/Projects/Aptana/rubles/text.ruble/bundle.rb which deletes all my samples. It seems like we should only delete (and re-add) the samples associated with my bundle, not the whole lot. FWIW, TemplateManager seems to only listen for ElementVisibility. When I comment out the load-cycle listener, it seems to still work fine and I don't get the add/remove/add. Also, If it do the same ModelFilter and comment out the remove part of loadBundleSampleElements() (make it the same effectively as loadTemplatesFromBundles()) It also seems to work fine for me.
Story points: 8