Community
Participate
Working Groups
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?
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.
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.
We are no longer using OpenAjax so this is no longer relevant.