Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337871 - [client] timing problem causes OpenAjaxHub error when running Firebug with "Break on error"
Summary: [client] timing problem causes OpenAjaxHub error when running Firebug with "B...
Status: RESOLVED INVALID
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Simon Kaegi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-22 13:06 EST by Susan McCourt CLA
Modified: 2011-08-30 10:22 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2011-02-22 13:06:20 EST
As part of working on bug 337647, I needed to move the code where we traverse the "editorActions" extension point from the bottom of the glue code to a pluggable "feature" of the editor that knows about the generic editor commands, the extension points, etc.  This feature is now triggered during editor creation (just after the editor widget is created) rather than at the very end of the glue assembling all the js components.

The net effect is that the registry contacts the plug-ins earlier than it used to.  And I end up with a JSON.parse error in OpenAjaxHub-all because it's trying to parse a postMessage whose contents are "postmessage.test"

In googling for "postmessage.test" I learned that this message is used by implementations to check whether the browser truly supports asynch postMessage or whether it's a synchronous implementation.

So my theory is that we are initializing the hub before that test is run, and so the hub tries to parse it as a real message?
Comment 1 Susan McCourt CLA 2011-02-22 13:07:19 EST
If I turn off firebug "break on error" everything operates normally and no errors appear in the console.

cc'ing Jon in case this is a well-known initialization issue.
Comment 2 Simon Kaegi CLA 2011-02-22 15:04:23 EST
I looked at this and what's happening is that OAHub does JSON.parse in a try/catch block and just returns for this case. This is maybe not perfect but not really a bug in OAHub and more likely something in our own code that we will have to figure out by walking our way through.

My guess is that what's happening is that some other task in our code kicked off via setTimeout 0 or similar is assuming the pluginregistry(?) is initialized and then returning something unexpected and that's why the editor is not showing the file even after resumed after the break.

I'll do an initial investigation.
Comment 3 John Arthorne CLA 2011-06-06 09:03:21 EDT
We are no longer using OpenAjax so this is no longer relevant.