[TIMOB-1203] setTimeout Android Issue
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-07-26T19:57:10.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | look1 |
Reporter | Biztactix |
Assignee | Neeraj Gupta |
Created | 2011-04-15T02:46:33.000+0000 |
Updated | 2017-03-16T22:05:27.000+0000 |
Description
The following usecase demonstrates that setTimeout() periods of
1000ms complete successfully for this specific code, whereas those
with 3000ms periods do not run.
http://pastebin.com/raw.php?i=4Fzdx1qG">http://pastebin.com/raw.php?i=4Fzdx1qG
I speculate that the reason for this is the script has completed
execution within the 3000ms timeout period, causing the timeout to
be disregarded. Conversely, 1000ms is long enough for the
command/function inside setTimeout() to fire before the script
finishes.
Please do not rely on my previous assumptions of tabGroups being the cause of the issue. Also, opening a window is not a reliable workaround - it may have seemed to resolve the issue in some cases, but I think this was simply due to the fact that doing so extended the script execution time long enough for setTimeout to complete.
Please note that investigation into the true cause of this issue is required - the script execution idea I stated above is just a theory.
Please also note Bill Dawson's ticket #3083 regarding setTimeout, which may possibly be relevant.
Original poster noted that the setTimeout timer keeps on ticking away, as evident from the trace.
Assigning to Don for triage.
The reason these timeouts don't work is because you're opening a new activity (TabGroup) on top of the one from app.js. In 3 seconds, the TabGroup has opened, and the Activity that the timeouts exist on is now suspended.
sorry, made a mistake: it does work!
This should no longer be an issue post 1.8.0 since we removed this suspending behavior.
Closing ticket as fixed.