ghcjs / ghcjs-dom

Make Document Object Model (DOM) apps that run in any browser and natively using WebKitGtk
74 stars 41 forks source link

ghcjs-dom 0.9.4 somehow causes websocket failure in CodeWorld #97

Open cdsmith opened 4 years ago

cdsmith commented 4 years ago

I apologize in advance for a terrible bug report, but I wanted to document what I know about this so far. Building codeworld-api with GHCJS and ghcjs-dom 0.9.4 causes use of websockets to fail as described in https://github.com/google/codeworld/issues/1382. The same does not occur when building against ghcjs-dom 0.9.2 (the previous version on hackage).

The weird thing is that codeworld-api isn't using ghcjs-dom for websockets. It's using the JavaScript.Web.WebSocket module from ghcjs-base, which doesn't depend on ghcjs-dom at all. So I don't understand the mechanism behind the failure. Yet the bug definitely correlates with that ghcjs-dom version.

I can try to construct a smaller test case this weekend. Until then, the relevant code is in https://github.com/google/codeworld/blob/master/codeworld-api/src/CodeWorld/Driver.hs

3noch commented 4 years ago

I doubt it's related but I'll take this opportunity to point out that ghcjs has a rather serious bug fixed by https://github.com/ghcjs/ghcjs/pull/788. I'd suggest at least testing that when you encounter mysterious errors.

cdsmith commented 4 years ago

@3noch Thanks, that is good to know. I also doubt it's related to this issue, but it is worth fixing. I already build a patched GHCJS for CodeWorld, so it will be easy to apply this patch, as well.