[Patch] Bugfix: infinite loop in enyo.list.PageStrategy

edited March 2012 in Enyo 1.0
This patch fixes an infinite loop bug of enyo.list.PageStrategy.

You can reproduce this bug e.g. in the stock Messaging app (they use a FlyweightDbList, with bottomUp set to true):
Open a conversation into the right pane. Scroll up so you see white space at the bottom, and hold your finger (do not release it).
When you receive a message from the selected person (i.e. FlyweighDbList#refresh gets called), the infinite loop starts and the JS engine will freeze till the execution stack gets terminated by V8 (you see this in the logs as "JS script execution terminated" and "JS script timeout detected").

That "while (true)" statement is pretty bad design and should be rewritten. However, I've created a patch for this particular one bug.
Patch file: http://pastebin.com/tJBMPMEf
Or if you depend on webOS' built-in Enyo, you can add this command somewhere in your JS code (in a file that's after "$enyo/palm/list2/" in your depends.js): http://pastebin.com/2Gw3Ua7C

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Twitter