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

Key: LPP-4881
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P0 P0
Assignee: Henry Minsky
Reporter: Henry Minsky
Votes: 0
Watchers: 0
Operations

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

dataset loading timeout callback broken in swf and dhtml

Created: 11/Oct/07 02:39 PM   Updated: 15/Oct/07 07:40 PM
Component/s: LFC - Data
Affects Version/s: 4.0.5WaffleCone
Fix Version/s: RingDing (4.1)

Time Tracking:
Not Specified

Severity: Major
Fixed in Change#: 6,855
Runtime: N/A
Fix in hand: False


 Description  « Hide
This used to work in 3.4, now the ontimeout callback doesn't seem to get fired.

In swf, a warning is printed after 30 seconds and 60 seconds
WARNING: idle.returnData: <br><b>sleeping for 25 seconds...</b></br><br><b>done</b></br> already loaded
WARNING: idle.returnData: <br><b>sleeping for 25 seconds...</b></br><br><b>done</b></br> already loaded

as if the timeout handler is running, noticing that the loader has already gotten to a completed state, but not sending the appropriate event,

the 30 second default timeout is being used, so the user-specified 2 second timeout seems to be being ignored


test case:


<canvas width="100%" height="100%" debug="true">

<dataset name="mydata"
         request="false"
         type="http"
         timeout="2000"
         src="sleep.jsp?s=25"
         ondata="Debug.write('load complete', this.serialize())"
         ontimeout="canvas.timeout(this.name, this.timeout)"
         />

<button onclick="canvas.go()">load dataset with 2 seconds timeout</button>

<method name="go">
  this.stime = getTimer();
  mydata.doRequest();
</method>

<method name="timeout" args="caller, timeoutValue">
  Debug.write(caller + ' timed out with a timeout value of ' + timeoutValue + '.');
  Debug.write('delay was '+ (getTimer() - stime));
</method>


</canvas>




sleep.jsp:
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<%@ page import="java.util.*,
      org.jdom.output.*"%>

<%
    int sec = 8;
    String s = request.getParameter("s");
    if (s != null) {
        sec = Integer.parseInt(s);
    }
int msec = sec * 1000;
out.println("<br><b>sleeping for " + sec + " seconds...</b></br>");
out.flush();
try {
Thread.sleep(msec);
} catch (Exception e) {
out.println("<br><i>Caught exception</i></br>");
out.flush();
}
out.println("<br><b>done</b></br>");
out.flush();
%>


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Henry Minsky - 15/Oct/07 07:40 PM
r6855 | hqm | 2007-10-15 22:36:23 -0400 (Mon, 15 Oct 2007) | 42 lines
Changed paths:
   M /openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzHTTPLoader.as
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java

Change 20071015-hqm-2 by hqm@IBM-2E06404CB67 on 2007-10-15 16:39:47 EDT
    in /cygdrive/c/users/hqm/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: fix dataset timeout event callback

New Features:

Bugs Fixed: LPP-4881

Technical Reviewer: andre
QA Reviewer: pkang
Doc Reviewer:

Documentation:

Release Notes:

Details:

The code in LzHttpDataProvider which dispatched on the datarequest
status type was
always calling loadResponse, which always set the requests status to
error if data was null.

Modified the code in LzHttpDataProcider.loadTimeout to just directly
call the onstatus event
iinstead of calling loadResponse.


DHTML timeout checking code rewritten by andre to be more efficient



Tests:

test/lfc/data/alldata.lzx
amazon app
calendar app
smokecheck