Ok, I actually figured out exactly what's causing production to run
differently than dev.

The problem is that GWT.runAsync() is behaving differently in dev
mode.
It's not actually running out of sync of the rest of the code. In
production, even if the code behind GWT.runAsync() has already been
loaded, it will STILL execute that code AFTER the currently running JS
has finished executing. IOW, that code executes as if you scheduled a
timer to run the code 1ms later, which will occur after all the
current JS is finished.

In dev mode it's not doing this, it's just running that code right
away. This completely changes things. If you have bad code (which I
do) that runs AFTER the GWT.runAsync() and you forget to assume that
an object is going to be null until the Async code executes, then what
this means is that in dev mode you WON'T have a bug but in production
you will!

The simple quick fix is to just do this:

<code>
        if(GWT.isScript()){
                createAsyncPage(...);//GWT.runAsync() is called inside here
        }else{
                Timer timer = new Timer() {
                        @Override
                        public void run() {
                                createAsyncPage(...);
                        }
                };
                timer.schedule(1);
        }
</code>

Doing this will emulate the same behavior in dev mode as what will
happen in production.

Hope this helps someone and I hope this reaches the GWT team so they
can fix this!

cheers ^^

On Feb 16, 10:33 am, Sky <myonceinalifet...@gmail.com> wrote:
> Forgot to say I'm using AppEngine version 1.4.2 and GWT 2.2.0,
> developing on Eclipse 3.5.2. Production is running on google's
> appengine.
>
> On Feb 16, 10:28 am, Sky <myonceinalifet...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I have two bugs that just cropped up but they only occur in production
> > and not in development mode.
> > One is an actual javascript error so I'll probably be able to figure
> > that one out without debugging, though it might be painful.
> > One does not give a javascript error but is a functionality problem
> > that occurs in production and not in dev mode. I was sure I knew the
> > cause of the problem by just knowing my code but after implementing
> > the fix it was not solved.
>
> > I know this problem is too generic for someone to figure out how the
> > compiled code is behaving differently than the java code, but does
> > anyone have any tips or tricks to help me out? I've always been able
> > to debug to find my gwt problems up till now.
>
> > I am not new to GWT development.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to