{ "id": "62838", "key": "TIMOB-2206", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2012-07-26T11:33:32.000+0000", "created": "2011-04-15T03:13:30.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "19344", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "94532", "key": "TIMOB-9901", "fields": { "summary": "TiAPI: Review and clean up platform bugs and reduce bug count by 20%.", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-26T21:44:31.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

While trying to demonstrate another problem I created a new\nhello world project and run into this. (Android simulator, APIs\n2.1-update1, HVGA. Titanium SDK 1.4.0, Titanium Developer (1.2.1)\n)

\n

Press the launch-button in Titanium Developer, watch if Alert1\n(Hej1), Alert2 (Hej2), Alert3(Hej3) and \"Timer\" is showing on the\ndisplay.
\nRe-press the launch-button, watch for the same thing.
\nRe-press the launch-button, watch for the same thing.
\nRe-press the launch-button, watch for the same thing.
\nRe-press the launch-button, watch for the same thing.
\nRe-press the launch-button, watch for the same thing.
\nRe-press the launch-button, watch for the same thing.
\nRe-press the launch-button, watch for the same thing.

\n

Most of the time I get Alert3 and Alert2 to show. Sometimes also\nTimer (1 time). One out of ten times, the timer is actually\nworking. I might see Alert1 briefly, then covered by the\nwindow.

\n

Here is the code (look at bottom lines for changes to the\nHelloWorld project).
\n----------- app.js --------------

\n

// this sets the background color of the master UIView (when\nthere are no windows/tab groups on it)\nTitanium.UI.setBackgroundColor('#000');

\n

// create tab group var tabGroup =\nTitanium.UI.createTabGroup();

\n

// // create base UI tab and root window // var win1 =\nTitanium.UI.createWindow({

\n
\ntitle:'Tab 1',\nbackgroundColor:'#fff'\n
\n

}); var tab1 = Titanium.UI.createTab({

\n
\nicon:'KS_nav_views.png',\ntitle:'Tab 1',\nwindow:win1\n
\n

});

\n

var label1 = Titanium.UI.createLabel({

\n
\ncolor:'#999',\ntext:'I am Window 1',\nfont:{fontSize:20,fontFamily:'Helvetica Neue'},\ntextAlign:'center',\nwidth:'auto'\n
\n

});

\n

win1.add(label1);

\n

// // create controls tab and root window // var win2 =\nTitanium.UI.createWindow({

\n
\ntitle:'Tab 2',\nbackgroundColor:'#fff',\n
\n

});

\n

var tab2 = Titanium.UI.createTab({

\n
\nicon:'KS_nav_ui.png',\ntitle:'Tab 2',\nwindow:win2\n
\n

});

\n

var label2 = Titanium.UI.createLabel({

\n
\ncolor:'#999',\ntext:'I am Window 2',\nfont:{fontSize:20,fontFamily:'Helvetica Neue'},\ntextAlign:'center',\nwidth:'auto'\n
\n

});

\n

win2.add(label2);

\n

// // add tabs // tabGroup.addTab(tab1);
\ntabGroup.addTab(tab2);

\n

// open tab group tabGroup.open();
\nalert('Hej1');
\nalert('Hej2');
\nvar A = setInterval(function(){alert('Timeout');},1000);
\nalert('Hej3');
\n---------------------log of when timer showed once!\n------------------------- [TRACE] I/Log ( 1385): (main) [1,1]\ncheckpoint, app created. [TRACE] I/Log ( 1385): (main) [0,0]\ncheckpoint, on root activity create. [TRACE] D/TiApplication( 1385): (main)\n[87,87] Analytics Event: type=ti.start [TRACE] D/TiApplication( 1385):\nevent=ti.start [TRACE] D/TiApplication( 1385):\ntimestamp=2010-10-27T20:19:23.032+0000 [TRACE] D/TiApplication( 1385):\nmid=b47c75af-f1fe-49c9-989c-49d608652d73 [TRACE] D/TiApplication( 1385):\nsid=43073f16-c401-4cf5-b844-2d4f13d345cb [TRACE] D/TiApplication( 1385):\naguid=b10cb0a2-30ab-4e2c-87da-eadd08ba8f39 [TRACE] D/TiApplication( 1385): isJSON=true\n[TRACE] D/TiApplication( 1385):\npayload={os [TRACE] D/dalvikvm( 1385): GC freed 3858\nobjects / 373664 bytes in 83ms [TRACE] E/ROOT ( 1385): (main) [441,528]\nLeaving TiRootActivity.onCreate [TRACE] I/Log ( 1385): (main) [0,0]\ncheckpoint, on root activity resume. [TRACE] I/TiRootActivity( 1385): (Thread-9)\n[18,18] eval app.js [TRACE] D/KrollContext( 1385):\n(kroll$1) [6,24] eval file: app://app.js [TRACE] W/TiAnalyticsSvc( 1385):\n(Thread-10) [60,84] Analytics Service Started [TRACE] I/ActivityManager( 53): Displayed\nactivity com.x.testofevetargs/.TestofevetargsActivity: 2243 ms\n(total 2243 ms) [TRACE] I/TabGroupProxy( 1385): (main)\n[580,664] handleOpen [TRACE] I/ActivityManager( 53):\nStarting activity: Intent {\ncmp=com.x.testofevetargs/ti.modules.titanium.ui.TiTabActivity (has\nextras) } [TRACE] I/ALERT ( 1385): (kroll$1) [51,715]\nHej1 [TRACE] W/TiTabActivity( 1385): (main)\n[72,787] Notifying TiTabGroup, activity is created [TRACE] I/ALERT ( 1385): (kroll$1)\n[124,911] Hej2 [TRACE] I/ALERT ( 1385): (kroll$1)\n[107,1018] Hej3 [TRACE] D/dalvikvm( 1385): GC freed 5138\nobjects / 305216 bytes in 134ms [TRACE] W/TiActivity( 1385): (main)\n[528,1546] Notifying TiUIWindow, activity is created [TRACE] D/TitaniumModule( 1385): (Timer-0)\n[472,2018] calling interval timer 0 @1288210765501 [TRACE] I/ALERT ( 1385): (kroll$1) [7,2025]\nTimeout [TRACE] I/ActivityManager( 53): Displayed\nactivity com.x.testofevetargs/ti.modules.titanium.ui.TiTabActivity:\n1415 ms (total 1415 ms) [TRACE] I/TiAnalyticsSvc( 1385):\n(Thread-10) [1000,3025] Sending 1 analytics events. [TRACE] D/dalvikvm( 1385): GC freed 5580\nobjects / 378480 bytes in 91ms [TRACE] D/dalvikvm( 1385): GC freed 3589\nobjects / 190760 bytes in 86ms [TRACE] W/TiAnalyticsSvc( 1385):\n(Thread-10) [3268,6293] Stopping Analytics Service

{html}", "attachment": [], "flagged": false, "summary": "setInterval unreliable runs code 0, 1 or repeatadly.", "creator": { "name": "andersh.", "key": "andersh.", "displayName": "Anders H.", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "andersh.", "key": "andersh.", "displayName": "Anders H.", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "209648", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot reproduce in SDK 2.2.0.014b86f with iPhone Sim 5.1.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-26T11:33:32.000+0000", "updated": "2012-07-26T11:33:32.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }