Strange RPC regression in GWT 2.5

439 views
Skip to first unread message

Andy

unread,
Nov 30, 2012, 10:04:21 AM11/30/12
to google-we...@googlegroups.com
I'm not logging an issue yet because I don't have nearly enough information to attempt to document the issue. Instead, I wanted to share what I'm seeing and to see if anyone else has had a similar experience.

For some background, we have a mature GWT application and have been happily using GWT in production since around 1.5 and were experimenting with it a little before that. The code that is suddenly causing issues hasn't been touched in a while. The product is TeamPage at http://tractionsoftware.com

The issue is as follows:

* About 50% of the time when clicking and holding a hash style link and selecting "Open in New Tab" on iOS 6, part of the RPC response is not properly deserialized. It can also happen when clicking a link from an email message that opens in Safari in a new tab.

As you can imagine, we've been struggling to diagnose this. It only happens in iOS6 and only when opening in a new tab or a fresh view. We have not seen any similar issues in any other browsers.

I tried a GWT build from r11390 and it still happens. I reverted to GWT 2.4 and the problem went away.

We have an RPC service method that looks like this:

    public ViewData get(ViewRequest request) throws GwtTractionException;

The ViewData object returned looks like this:

    public final class ViewData implements ViewContent, GetProperty2 {
        private String name;
        private HashMap<String,String> properties = new HashMap<String,String>();
        private HashMap<String,ArrayList<ViewContent>> content;
    }

ViewContent is a simple marker interface for Objects that can be sent back as view content. Since ViewData implements ViewContent, we often have a recursive tree of ViewData, but a few other objects implement ViewContent as well.

    public interface ViewContent extends IsSerializable {}

* The problem is that content comes back empty, when in fact it should have data. properties and name are properly deserialized and non-empty. content is undefined.

I've inspected with wireshark and the RPC payload is identical in cases that work and fail. As I mentioned, it only fails 50% of the time. When it fails, the value of "content" in javascript is undefined and a ViewContent implementation that we expect to be there causes an UmbrellaException with TypeError of 'null' is not an object.

So my questions are as follows:

1) Is anyone else seeing strange RPC issues from iOS 6 when opening links in new tabs?

2) Does anyone have a suggestion on where I should look in GWT src to investigate the issue?

Sorry this is so vague. I'm happy to provide any more information that might be helpful.

-Andy




Joseph Lust

unread,
Nov 30, 2012, 10:43:30 AM11/30/12
to google-we...@googlegroups.com
A shot in the dark here, but have you seen the iOS6 Post Caching issue? If your app was caching an earlier blank response, that could be the issue.


Sincerely,
Joseph

Andy

unread,
Nov 30, 2012, 11:00:07 AM11/30/12
to google-we...@googlegroups.com
Good suggestion, but we've addressed that issue (and it was also an issue with GWT 2.4 so backporting wouldn't have resolved it). iOS 6.0.1 also stopped caching posts. Thanks for the input!

Jens

unread,
Nov 30, 2012, 12:29:01 PM11/30/12
to google-we...@googlegroups.com
You should warn your customers then using iOS6 can result in unpredictable app behavior. Its not just the POST caching issue in iOS 6. The JS engine on iOS 6 seems to have some serious bugs. In this group someone posted an iOS 6 issue where HashMap.put stops working for him (maybe related to your issue as you use HashMaps). 

My example:

An app that works with GWT 2.4 stops working with GWT 2.5 on iOS 6 but both versions work with iOS 5. To investigate we connected to iOS 6 using Safari's remote debugging tools and suddenly the app works again with GWT 2.5 and no further modifications. Disconnect from remote debugging lets the app break again. Also it does not always break at the same app state. Sometimes it simply fails to load and sometimes it loads but fails during a place change.

Normally we send unexpected JS exceptions to a server so we can deobfuscate its stack trace and fix it. In this case nothing gets send to the server so we had to add some logging code as we cant remote debug. So we added a while loop which prints the exception stack trace (its a while loop because of possible GWT UmbrellaExceptions), compiled the app and suddenly it works again. Then removed the code again, recompiled and its broken again.

We have taken both compilations (with and without this logging while loop), corrected the GWT generated MD5 file names and then run a diff on everything. The only difference was the while loop code, that really was very very simple. So about 10 lines of code are different.

So we keep the loop in, it really does nothing, but the app "somehow works" on iOS 6 with GWT 2.5 but maybe it still breaks in certain circumstances.

No idea whats going on here but I hope that Apple will know whats going on and will fix its JS engine in iOS 6.1. Not sure what they have done but they clearly have done something wrong.

So be prepared that you simply can't solve your issue.

-- J.

Jens

unread,
Nov 30, 2012, 12:31:34 PM11/30/12
to google-we...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages