The sample project here
https://www.dropbox.com/s/q9lmvrx6nloyua5/wordtin.zip?dl=0
exhibits odd behaviour when trying to bind a manually created backbone collection to two different views. If you run the code in 5.0.x.GA you can see words displayed on the screen which you can scroll through. Clicking the settings button reveals the same words (same collection) in a table -- clicking the top right button will "reset" the words and change the collection.
Run the project in 5.0.X and it works fine
Run the project in 5.1.X and it crashes / hangs when attempting to render the second list (clicking settings) and also crashes trying to reset a collections contents.
Run the project in 5.1.X with "execute in main thread" set to TRUE and it works as expected.
Note -- this got created under Appc Community -- but I am building with the Titanium CLI -- so ti build
PR: https://github.com/appcelerator/titanium_mobile/pull/7553/files
CR and FT passed. PR Merged.
Backport PR here: https://github.com/appcelerator/titanium_mobile/pull/7555
[~cng] would it be possible to merge this for 5.1.2.GA? Even though this ScrollView bug exists since 5.0.0.GA it wasn't showing because we mistakingly enabled main thread by default in 5.0.X which ironically counterbalanced it. But now we've fixed that in 5.1.0.GA this bug became effective and causing the described odd behaviour or even hanging the app on start.
Verified fixed, using: MacOS 10.11.2 (15C50) Studio 4.4.0.201511241829 Ti SDK 5.1.2.v20151216190036 Appc NPM 4.2.2 Appc CLI 5.1.0 Xcode 7.2 (7C68) The manually created collection can be seen on the two bound views without hanging or crashing. Tested with the sample app provided on iPad Sims and device with runOnMainThread explicitly set to false, true, and not set at all.
In 5.2RC issue back. Please check my notes, here https://github.com/appcelerator/titanium_mobile/pull/7627/files
Confirmed this issue is reproducible again, with environment: MacOS 10.11.3 (15D21) Studio 4.5.0.201602170821 Ti SDK 5.2.0.v20160216202526 Appc NPM 4.2.3-2 Appc CLI 5.2.0-269 Alloy 1.7.33 Xcode 7.2 (7C68) App freezes with
<run-on-main-thread>
set to false, but works as expected when set to true. Tested with provided app (removed the leading '/' from the path on line 21 of index.js) on iPad sims, iOS 9.2 and iPad 2, iOS 8.4.1PR(Master): https://github.com/appcelerator/titanium_mobile/pull/7760 PR(5_2_X): https://github.com/appcelerator/titanium_mobile/pull/7759
Next time I will do PR my self :)
[~nunocostapt] Okay sounds good :), extra enthusiasm by the community is always good and welcomed! Sorry for the delay on the PR, there is 3 or tickets all related to the same issue, was not able to re-procude it on the other 2. It was only thanks to Eric that we succeeded in re-producing it.
I tried linked all those ticked better as I could. Thanks!
CheeKiat Ng and Angel Petkov , I tested all those before come up with my notes and the fix, seams all good!
Regression fixed with the latest PR. Nevertheless, we need to focus the mentioned tickets to be double-checked when we support mainthread and autolayout by default.
Verified fixed, using: MacOS 10.11.3 (15D21) Studio 4.5.0.201602170821 Ti SDK 5.2.0.v20160220080449 Appc NPM 4.2.3-2 Appc CLI 5.2.0-269 Alloy 1.7.33 Xcode 7.2 (7C68) App no longer freezes with
<run-on-main-thread>
set to false, true, or not set. Tested using provided sample app and tests provided in TIMOB-20138 and TIMOB-20196, on iOS 9.2 iPad sim and iOS 8.4.1 iPad 2