Titanium JIRA Archive
Alloy (ALOY)

[ALOY-922] Alloy: Previously working code crashes with Alloy 1.3.0 + Titanium SDK 3.2.0

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-11-26T22:42:36.000+0000
Affected Version/sAlloy 1.3.0
Fix Version/sAlloy 1.4.0, Alloy 1.3.1, 2014 Sprint 01
ComponentsXML
Labelsqe-manualtest, regression
ReporterHenry David Spells III
AssigneeTony Lukasavage
Created2014-01-09T02:41:18.000+0000
Updated2014-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) {
    }

Comments

  1. Ritu Agrawal 2014-01-12

    Moving this ticket to engineering for further evaluation as we can reproduce the issue with the provided test case on iOS simulator.
  2. Tony Lukasavage 2014-01-13

    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.
  3. Henry David Spells III 2014-01-14

    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.
  4. Tony Lukasavage 2014-01-14

    [~dspells] this will be part of the official 1.3.1 Alloy release, but you can also get the beta right now.
       npm install -g alloy@1.3.1-beta3
       
  5. Henry David Spells III 2014-01-14

    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?
  6. Tony Lukasavage 2014-01-15

    [~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:
       sudo npm cache clean
       sudo npm uninstall -g alloy
       sudo npm install -g alloy@1.3.1-beta3
       
    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.
  7. Henry David Spells III 2014-01-15

    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.
  8. Federico Casali 2014-02-05

    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

JSON Source