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

Key: LPP-4099
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P0 P0
Assignee: Unassigned
Reporter: yuwen fang
Votes: 0
Watchers: 0
Operations

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

Can't get onerror event while loading resources from 403 forbidden image links

Created: 05/Jun/07 05:34 PM   Updated: 07/Nov/07 02:18 PM
Component/s: Debugger warnings
Affects Version/s: 4.0.2, 4.0.0
Fix Version/s: Cranberry

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 6,975
Runtime: N/A
Flags: Support
Fix in hand: False


 Description  « Hide
Test case:

<canvas debug="true">
   <view resource="http://www.javawen.info/try/bg.jpg"/>
   <view resource="http://www.javawen.info/try/border.png"/>
   <view resource="http://www.javawen.info/try/featured_bg.png"/>
   <view resource="http://www.javawen.info/try/featured_bg_edit.png">
   <view resource="http://www.javawen.info/try/news_bg.png"/>
</canvas>


Usually we get warning rather than expected error.

WARNING: border.png (loaded).returnData: border.png (loaded) already loaded
WARNING: bg.jpg (loaded).returnData: bg.jpg (loaded) already loaded
WARNING: featured_bg.png (loaded).returnData: featured_bg.png (loaded) already loaded
WARNING: featured_bg_edit.png (loaded).returnData: featured_bg_edit.png (loaded) already loaded
WARNING: news_bg.png (loaded).returnData: news_bg.png (loaded) already loaded

The expected error should be

ERROR: data source error for http://www.javawen.info/try/bg.jpg: HTTP Status code: 403:Forbidden



This bug only happens above OL4.0


-Yuwen









 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
P T Withington - 20/Jun/07 01:13 PM
To verify

Philip Romanik - 22/Jun/07 08:33 AM
In swf, you don't always get each error reported as a 403. Something you get a warning,

WARNING: featured_bg_edit.png (loaded).returnData: featured_bg_edit.png (loaded) already loaded


In dhtml, no errors or warnings are generated.

Amy Muntz - 16/Oct/07 12:09 PM
Henry - looks like a regression in behavior from 3.x. Can you please take a look?

Henry Minsky - 16/Oct/07 01:32 PM
Hmm, I wonder if this broke when the dataprovider stuff went in. I can reproduce the test case, I am looking at it now.


Henry Minsky - 17/Oct/07 08:58 AM
Note: There are the following cases, which really go through 24 different code paths. The tests in test/lfc/data cover
only the normal load cases. We need to add regression tests to the suite to cover the error and timeout cases as well.


SWF

SOLO PROXIED
data load normal
data load error
data load timeout

media load normal
media load error
media load timeout


DHTML

SOLO PROXIED
data load normal
data load error
data load timeout

media load normal
media load error
media load timeout

Henry Minsky - 19/Oct/07 12:12 PM
Here is the bug, in proxied mode: The LPS server returns an "eror" swf, which instead of containing an image asset, contains
a call to "returnData" with an error message as it's data.

The LzMediaLoader receives this 'error' swf, but doesn't know it's an error, so calls returnData which marks the resource as loaded.
The error swf itself calls back to returnData as well, but some code changed since LPS 3.x, and it ignores the second
call to returnData, which would normally fire the onerror event.

I have a patch, am testing it now.

Note that in SOLO mode, we really don't get any indication of a failure to load; the loadMovie just returns, regardless of
any HTTP error from the server. So the best we can do in that case is timeout :-(


Henry Minsky - 23/Oct/07 09:42 AM
out to ptw, pbr for review

Henry Minsky - 23/Oct/07 01:06 PM
r6975 | hqm | 2007-10-23 16:05:36 -0400 (Tue, 23 Oct 2007) | 54 lines
Changed paths:
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs

Change 20071023-hqm-8 by hqm@IBM-2E06404CB67 on 2007-10-23 12:09:47 EDT
    in /cygdrive/c/users/hqm/openlaszlo/trunk/WEB-INF/lps/lfc
    for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc

Summary: fix to report errors in media loading

New Features:

Bugs Fixed: LPP-4099

Technical Reviewer: max
QA Reviewer: pbr
Doc Reviewer:

Documentation:

Release Notes:

Details:

In the case of a server media error, the media loader calls returnData
twice, once when the image swf is loaded (normal path), and the error
swf itself calls returnData.

That second call was being ignored by returnData because it ignored
any loader which was marked as loaded.

This fix adds a check for non-null data, and if so, returns it.


Tests:

test/lfc/data/testhttpdata.lzx
test/lfc/data/alldata.lzx



This should report an error immediately in proxied mode


<canvas width="100%" height="80%" debug="true">
  <debug fontsize="12"/>

  <view resource="http://www.javawen.info/try/news_bg.png"
        onload="Debug.write('onload', this)"
        ontimeout="Debug.write('ontimeout', this)"
        onerror="Debug.write('onerror', this)"
/>

</canvas>



Max Carlson - 23/Oct/07 02:21 PM
The testcase doesn't work in 3.x. Did it ever work? Is this a regression or a new feature?

Henry Minsky - 23/Oct/07 02:43 PM
Whenever this line was added to LzLoader , probably is what broke it

    // Check if returnData has already been called on this
    // object. This can happen if a serverless data load timed out in
    // the LFC, but eventually returned something via the
    // LoadVars.sendAndLoad() callback.
    if (loadobj.loaded) {
        if ($debug) {
            Debug.warn("%w.returnData: %w already loaded",
                       this, loadobj);
        }
        return;
    }

I tried svn blame but this must go back to when things were in perforce...


Henry Minsky - 28/Oct/07 06:36 PM
merged to wafflecone with r7038

Mamye Kratt - 06/Nov/07 02:12 PM
Correct testcase in original description, see below (missing "/"):
<canvas debug="true">
   <view resource="http://www.javawen.info/try/bg.jpg"/>
   <view resource="http://www.javawen.info/try/border.png"/>
   <view resource="http://www.javawen.info/try/featured_bg.png"/>
   <view resource="http://www.javawen.info/try/featured_bg_edit.png"/>
   <view resource="http://www.javawen.info/try/news_bg.png"/>
</canvas>

Mamye Kratt - 06/Nov/07 03:29 PM
<canvas width="100%" height="80%" debug="true">
  <debug fontsize="12"/>
  
<view resource="http://www.javawen.info/try/news_bg.png"
        onload="Debug.write('onload', this)"
        ontimeout="Debug.write('ontimeout', this)"
        onerror="Debug.write('onerror', this)"
/>
  
</canvas>

Mamye Kratt - 06/Nov/07 03:43 PM
(local wafflecone build r7136 - cranberry RC)
This doesn't appear to be the correct behavior described in the bug. I would think that the error should be in both swf and dhtml. Also the warnings, are these ok? I get the same behavior on XP/FF, XP/IE6 and OS X/FF.

I get the following error in swf (expected)
onload «MovieClip#0| global»
ERROR: data source error for http://www.javawen.info/try/news_bg.png: HTTP Status code: 403:Forbidden
onerror «lz.view#2»

I get the following when I run it in dhtml:
DEBUG: Source warnings enabledWARNING: testing:0: Test source warning
onload «Window(0)#0| global»
onerror «lz.view#1»

I get the following compiler warnings in dhtml and swf:
4099.lzx:8:3: attribute "onload" not allowed at this point; ignored
4099.lzx:8:3: attribute "ontimeout" not allowed at this point; ignored
4099.lzx:8:3: attribute "onerror" not allowed at this point; ignored
4099.lzx:8:3: found an unknown attribute named "onload" on element view, check the spelling of this attribute name

Mamye Kratt - 06/Nov/07 03:44 PM
The above results are from running the testcase below:
 <canvas width="100%" height="80%" debug="true">
  <debug fontsize="12"/>
  
<view resource="http://www.javawen.info/try/news_bg.png"
        onload="Debug.write('onload', this)"
        ontimeout="Debug.write('ontimeout', this)"
        onerror="Debug.write('onerror', this)"
/>
  
</canvas>

Henry Minsky - 06/Nov/07 05:57 PM
There are some changes from trunk that have not been merged to wafflecone which are required in order
to compile view with onload, ontimeout, or onerror attributes

<view onload="...." ontimeout=... onerror="..."/>

without warnings

Basically all the new schema stuff needs to go in for that to work.

Henry Minsky - 06/Nov/07 05:58 PM
However, the warnings in the test case are independent of the issue in this bug, which is whether or not
the onerror event is properly sent at runtime when a media load error occurs.

Mamye Kratt - 07/Nov/07 02:16 PM
(trunk4 local build r7183)
The compiler warnings do not happen in trunk builds. The changes needed to get the compiler warnings to stop are too risky for the wafflecon/cranberry/4.0.7 release. Basically all the new schema stuff needs to go into wafflecone for that to work.

Mamye Kratt - 07/Nov/07 02:18 PM
Close, see previous comment.