History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5390
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P0 P0
Assignee: Mamye Kratt
Reporter: Dan Swaney
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

When using IE or Firefox: Repeated <dataset> updates will eventually cause replicated <text> views to randomly disappear/reappear.

Created: 29/Jan/08 01:59 PM   Updated: 14/Feb/08 07:25 PM
Component/s: Kernel - DHTML
Affects Version/s: RingDing (4.1)
Fix Version/s: RingDing (4.1)

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

File Attachments: 1. Zip Archive LPP_5176_Revisited.zip (14 kb)

Environment:
Using OpenLaszlo 4.0.6 Server with lzr=dhtml

Severity: Blocker
Fixed in Change#: 8,034
Fixed in branch: trunk
Runtime: N/A
Fix in hand: False

Sub-Tasks  All   Open   

 Description  « Hide
(Decription removed. See following comments for bug description)


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dan Swaney - 29/Jan/08 02:00 PM
How do I attach examples?

Dan Swaney - 29/Jan/08 02:05 PM
See LPP-5176 for history of this ticket...

Dan Swaney - 30/Jan/08 02:28 PM
When using replicated <text> views that are mapped to update directly from dataset changes, initially this will appear to work as expected.

After repeated changes to the dataset, eventually right-justified <text> views
will randomly disappear and reappear. <text> views that always have the
same values are not affected.

My guess is that each new unique string that is displayed takes up an entry in a 'LzTextSprite.prototype._sizecache' that has an upper limit of 1000 (defined as LzTextSprite.prototype.__sizecacheupperbound).

The _sizecache stores elements indexed by their 'style' value (that includes width & font size):
Q: If the text is right-justified, doesn't the width vary after each update?
Q: Perhaps a partial fix would be to not include the width if the text is right-justified?

The returned value from _sizecache[style] is another cache called '_textsizecache'.
This is indexed by two different keys: tagname and the actual display string.
What this appears to mean is that every single text value ever displayed is
stored in this cache? So over time would this cause memory problems? How is this released?

Philip Romanik - 08/Feb/08 09:26 AM
Modified version affected and original bug description. From Dan:

The first description under LPP-5390 needs to be removed -- it describes LPP-5176 (caused by the 'Clone Ticket').
The comment at the bottom is the correct description -- the attachment should help repro the problem easily.
The defect also only repros using RingDing -- not 4.0.6.


Dan Swaney - 14/Feb/08 07:39 AM
See attachment for code example that reproduces the problem.

Included in the attachment is a README file that explains the test steps to reproduce it.

Philip Romanik - 14/Feb/08 07:25 PM
Change 20080214-Philip-4 by Philip@Philip-DC on 2008-02-14 08:54:44 EST
     in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/trunk
     for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Access text cache as LzTextSprite.prototype._sizecache

New Features:

Bugs Fixed: LPP-5390

Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
The code used to access the global cache through 'this'. However, once the cache
  is full and is cleared, access through 'this' it not reliable. I changed this._ sizecache to LzTextSprite.prototype._sizecache. Although I only need to do this for the line that actually resets the cache, I changed all references to make it
  clear this is a global.


Tests:
See test in LPP-5390. This is slow to run since you need to wait until the _size cache.counter reaches 1000. During testing I set the cache size to 100 (ie. LzTe xtSprite.prototype.__sizecacheupperbound = 100) to verify the bug and the fix.

Files:
M WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080214-Philip-4.tar