PartLoader request sporadically returns "error" state

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PartLoader request sporadically returns "error" state

kora
Hello

In the callback of the qx.io.PartLoader.require request we check the state(s).
If it's invalid or not "complete" a message box will rise.

Now sometimes / sporadically the message box rises ans shows the state "error".

- Has anybody an idea for the cause ?
- May this result of using the cache in the browser ? (We are in a test phase and do often update our javscript).


Here is the source code:

    openProofFileInNewWindow : function(id, name, pageNo, fileUID, fileFormat, status, version)
    {
        qx.io.PartLoader.require(["ProofWindow"], function(states)
        {
          this.debug("onProofWindowLoaded: state = " + states);
          if(states && (states[0] == "complete"))
          {
            var win = .....
            .
            .
            .

            win.open();
          }
          else
          {
            wpc.ui.dialog.MessageBox.showMessage(wpc.ui.dialog.MessageBox.mtError,
                                                 this.tr("Error loading part!") +
                                                 "<br><br>Part = ProofWindow<br>" +
                                                 "State = " + states);
          }
        }, this);
    }



Cheers

Kora
Reply | Threaded
Open this post in threaded view
|

Re: PartLoader request sporadically returns "error" state

Thomas Herchenroeder
One way to drill down into your problem is to use a packet sniffer (like
Wireshark or CharlesProxy) on the client to see which requests go out to
the server, and what the server responds. This would allow you to
distringuish between issues on the client and those on the server.

T.

On 09/30/2013 04:41 PM, kora wrote:

> Hello
>
> In the callback of the qx.io.PartLoader.require request we check the
> state(s).
> If it's invalid or not "complete" a message box will rise.
>
> Now sometimes / sporadically the message box rises ans shows the state
> "error".
>
> - Has anybody an idea for the cause ?
> - May this result of using the cache in the browser ? (We are in a test
> phase and do often update our javscript).
>
>
> Here is the source code:
>
>      openProofFileInNewWindow : function(id, name, pageNo, fileUID,
> fileFormat, status, version)
>      {
>          qx.io.PartLoader.require(["ProofWindow"], function(states)
>          {
>            this.debug("onProofWindowLoaded: state = " + states);
>            if(states && (states[0] == "complete"))
>            {
>              var win = .....
>              .
>              .
>              .
>
>              win.open();
>            }
>            else
>            {
>            
> wpc.ui.dialog.MessageBox.showMessage(wpc.ui.dialog.MessageBox.mtError,
>                                                   this.tr("Error loading
> part!") +
>                                                   "<br><br>Part =
> ProofWindow<br>" +
>                                                   "State = " + states);
>            }
>          }, this);
>      }
>
>
>
> Cheers
>
> Kora
>
>
>
> --
> View this message in context: http://qooxdoo.678.n2.nabble.com/PartLoader-request-sporadically-returns-error-state-tp7584692.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: PartLoader request sporadically returns "error" state

kora
In reply to this post by kora
The cause of the problem is the enabled browser cache.

Building the qooxdoo application deployment I get a couple of "myProject.<checksum>.js"
script files depending of my parts.

For example my main part "myProject.900d4fdc2539.js" loads other parts using "qx.io.PartLoader.require"

called, For example:

PartA - "myProject.e4b10dabf87a.js"
PartB - "myProject.900d4fdc2539.js"

Now changing my source of PartA it is getting an new name "myProject.95813726098c.js" after building.

Substitution of my webserver content results into the "Error loading part" using "qx.io.PartLoader.require".

The cause is the main part (in the cache) wants to load a PartA "myProject.e4b10dabf87a.js" that don't exist anymore.


Cheers

Kora
Reply | Threaded
Open this post in threaded view
|

Re: PartLoader request sporadically returns "error" state

Thomas Herchenroeder

On 10/07/2013 01:44 PM, kora wrote:

> The cause of the problem is the enabled browser cache.
>
> Building the qooxdoo application deployment I get a couple of
> "myProject.<checksum>.js"
> script files depending of my parts.
>
> For example my main part "myProject.900d4fdc2539.js" loads other parts using
> "qx.io.PartLoader.require"
>
> called, For example:
>
> PartA - "myProject.e4b10dabf87a.js"
> PartB - "myProject.900d4fdc2539.js"
>
> Now changing my source of PartA it is getting an new name
> "myProject.95813726098c.js" after building.
>
> Substitution of my webserver content results into the "Error loading part"
> using "qx.io.PartLoader.require".
>
> The cause is the main part (in the cache) wants to load a PartA
> "myProject.e4b10dabf87a.js" that don't exist anymore.

I'm not sure about this. If you create the 'build' version of your app,
an application loader is generated like "myProject.js", so this file
doesn't have a checksum part. It should always be updated on the server
as it contains the mapping to the other .js files.

If you now change something in PartA, one or several of the
myProject.<checksum>.js files will change, and new file names will be
generated. These changes are reflected in the "myProject.js" loader
file. Your main part only qx.io.PartLoader.require's a name (e.g.
"PartA"), but never a concrete .js file. The mapping of part name to .js
file(s) is done in the loader.

So, when deploying a new version to the server you have to make sure to
also copy the new loader, not just the "myProject.<checksum>.js" script
files. If you just copy the entire contents of the 'build/' folder you
should be fine (or the entire build/script folder if you are separating
scripts and resources). This way, all new script files are present, and
the new loader will faithfully retrieve them. You cannot continue to use
the old "myProject.js" loader with the new checksum files.

The browser will usually detect that the loader file has changed, and
will retrieve the new copy. If you find the loader is taken from the
cache you might want to add a no-cache directive to the web server for
this file so it is always re-fetched. It should be comparably small
while it is more efficient that the checksum files be cached in the client.

HTH,
T.


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel