[ALOY-922] Alloy: Previously working code crashes with Alloy 1.3.0 + Titanium SDK 3.2.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-11-26T22:42:36.000+0000 |
Affected Version/s | Alloy 1.3.0 |
Fix Version/s | Alloy 1.4.0, Alloy 1.3.1, 2014 Sprint 01 |
Components | XML |
Labels | qe-manualtest, regression |
Reporter | Henry David Spells III |
Assignee | Tony Lukasavage |
Created | 2014-01-09T02:41:18.000+0000 |
Updated | 2014-11-26T22:42:36.000+0000 |
Description
I looked in the release notes and didn't see anything that should cause this crash
This Alloy XML
<Alloy>
<Window id="settingsWin" title="Settings" class="container" tabBarHidden="true">
<ListView id="listView" defaultItemTemplate="template" allowsSelection="false">
<Templates>
<ItemTemplate id="inputTemplate" name="inputTemplate">
<TextField bindId="textfield" id="tf_username" onChange="TFUpdate" autocorrect="false" keyboardType="TI.Ui.KEYBOARD_EMAIL" hintText="User name / e-mail address"></TextField>
</ItemTemplate>
</Templates>
<ListSection headerTitle="Login Id" id="idSection">
<ListItem template="inputTemplate" textfield:value=""/>
</ListSection>
</ListView>
</Window>
</Alloy>
Generates JS code that crashes on
TFUpdate ? $.__views.tf_username.addEventListener("change", TFUpdate) : __defers["$.__views.tf_username!change!TFUpdate"] = true;
because $.__views.tf_username is undefined
This used to work and now it crashes
I don't believe that the definition of TFUpdate in the .js file is a factor. An empty definition should do.
function TFUpdate(e) {
}
Moving this ticket to engineering for further evaluation as we can reproduce the issue with the provided test case on iOS simulator.
commit: https://github.com/appcelerator/alloy/commit/6ae53d611ae7b5bfc719b86a1d9a65e7ec11e4b1 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-922 merged to both master and 1_3_X Functional test involves simply running the test app and asserting that the runtime error noted in the description does not occur. This requires no app interaction. If the error was still present it would occur immediately after the app loaded.
That's wonderful! Is there a way that I can find out when updates are scheduled without bothering you guys? I may need to put out an update of my app soon.
[~dspells] this will be part of the official 1.3.1 Alloy release, but you can also get the beta right now.
Thanks! That's very helpful. I did a "sudo npm install -g alloy@1.3.1-beta3" with titanium studio closed I verified that beta 3 was installed using npm -g list I opened titanium studio I did a clean I ran my project It still gets the same error Is it possible that the changes aren't in beta3?
[~dspells] Nope, just verified again and it is definitely in alloy@1.3.1-beta3. Run
alloy --version
to make sure your PATH is picking up the right version. Also, do the following to assert that there's nothing wrong with your npm setup:If you are still getting the error in your app after this, try the test app I linked above to rule out any issues with your own code.
Thanks for the clue on what to look for! For some reason when I uninstalled alloy, Version 1.3.0 was still left on the hard drive. Installing 1.3.1-beta3 got installed but it still found 1.3.0 first in the path. I ended up uninstalling beta3, manually deleting the alloy folders for 1.3.0 that nom had lost track of and then re-installing beta3. This worked. I guess I should have uninstalled alloy before installing beta 3 in the first place.
Verified as fixed. TiSDK 3.2.1.v20140203174850 Alloy 1.3.1-cr2 CLI 3.2.1-beta3 Appcelerator Studio 3.2.1.201402041206 iPhone 5 iOS 7 Android Google Nexus Galaxy 4.3 Closing