Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20138] Consecutive calls to ScrollableView.setViews causes the app to become unresponsive

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-01-06T21:23:09.000+0000
Affected Version/sRelease 5.1.0, Release 5.1.1
Fix Version/sRelease 5.2.0
ComponentsiOS
Labels5.1., ios, regression, scrollableView
ReporterNikos Poulios
AssigneePedro Enrique
Created2015-12-04T12:18:10.000+0000
Updated2016-02-18T21:09:51.000+0000

Description

Following a typical cycle of having a default view inside a scrollable view and then updating it calling setViews() fails and causes the app to become unresponsive. Tested on iOS > 8.4 Same effect if you try with a very short delay between the two calls. Code below works fine in 5.0.2.GA but not in 5.1.0/5.1.1
(function() {
	var window = Ti.UI.createWindow();
	
	var mainView = Ti.UI.createView({
		backgroundColor:'#fff',
		width:Ti.UI.FILL,
		height:Ti.UI.FILL
	});
		
	var scrollableView = Ti.UI.createScrollableView({
		borderColor:'green',
		views:undefined,
		width:Ti.UI.FILL,
		height:'60%'
	});
	
	var viewA = Ti.UI.createView({
		backgroundColor:'black'
	});
	var colors = ['red', 'green', 'blue'];	
	var viewsB = [];
	for(var i = 0;i<3;i++){
		viewsB.push(Ti.UI.createView({
			backgroundColor:colors[i]
		}));
	}	
	scrollableView.setViews([viewA]);
	mainView.add(scrollableView);
	window.add(mainView);
	window.open();
	scrollableView.setViews(viewsB);	
})();

Attachments

FileDateSize
Ti502-Passes.png2015-12-14T11:29:26.000+000016129
Ti511-Fails.png2015-12-14T11:28:43.000+000016002

Comments

  1. Gertjan Smits 2015-12-14

    I'm also having this issue, is this on the radar?
  2. Fokke Zandbergen 2015-12-14

    Attached result on Ti 5.1.1 GA with iOS 9.2 Simulator and Ti 5.0.2.GA with same simulator. It's clear indeed that on 5.1.1 it does not work as expected.
  3. Nuno Costa 2015-12-16

    Some issue here, we have app that is havy dependent of this component, is give in us lot of issues lately (infinitive swipe). sdk 5.1.x, ios 9.1
  4. Eric Merriman 2015-12-29

    Verified a regression from 5.0.2 GA to 5.1.0 GA using iOS 9.2 simulator.
  5. Chee Kiat Ng 2015-12-29

    Verified problem still exist in 5.1.2.RC. [~penrique] can you take a look? Initially I thought it's to do with https://github.com/appcelerator/titanium_mobile/pull/7553 but it seems not to be the case.
  6. Pedro Enrique 2016-01-06

    It seems to me that this is some type of race condition. I'm investigating.
  7. Nuno Costa 2016-01-06

    @Pedro Enrique thanks, we are waiting for this fix to release a out app :)
  8. Pedro Enrique 2016-01-06

    Fixed in this PR https://github.com/appcelerator/titanium_mobile/pull/7617 It will be merged one time today.
  9. Nuno Costa 2016-01-06

    Pedro Enrique, count with me to test!
  10. Pedro Enrique 2016-01-06

    We just merged the pull request. The fix will be available soon in the CI builds. Check here later today http://build.appcelerator.net/
  11. Eric Wieber 2016-01-14

    Verified fixed, using: MacOS 10.11.2 (15C50) Studio 4.4.0.201511241829 Ti SDK 5.2.0.v20160114021251 Appc NPM 4.2.2 Appc CLI 5.2.0-224 Xcode 7.2 (7C68) Node v0.12.7 Java 1.7.0_80 App no longer becomes unresponsive after quickly calling setViews() or after multiple calls to setViews(). Tested with provided sample code and tests from related tickets.
  12. Rodolfo Perottoni 2016-02-12

    Tested with *5.2.0.v20160114021251 *and *5.2.0.v20160111111831* - both still make my app freeze whenever changing the *views* property. I've tried cleaning my project and making a fresh installation of the app: no deal. I'm using 4-5 views inside my scrollableview, i don't know if that means anything, but anyways...
  13. Chee Kiat Ng 2016-02-12

    [~rdperottoni] Did you try to reproduce using the sample code? Otherwise can you give us your sample code that cause the freeze?
  14. Nuno Costa 2016-02-18

    @Rodolfo Perottoni yeah! Can you see my note and see if fix for you? https://github.com/appcelerator/titanium_mobile/pull/7627/files Fixes for me, may help someone!
  15. Nuno Costa 2016-02-18

JSON Source