multipart/x-mixed-replace parsing bug breaks JS libs

Bug #1004019 reported by Bill Erickson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenSRF
Fix Released
Undecided
Unassigned
2.0
Fix Released
Undecided
Unassigned

Bug Description

There is what appears to be a bug in Mozilla's multipart/x-mixed-replace message parsing. At unpredictable times, the XHR.responseText value contains the part headers in addition to the response text. This results in failed JSON parsing and, due to how the JS libs are loaded through various layers of Dojo, the error never bubbles up to the console.

In user interfaces that leverage the OpenSRF JS libs, the bug will manifest as communication that quietly stops working. For example, if you were powering a dojo progress dialog via streaming JS, the bar would stop updating at some point and all communication would stop short of completing the overall request.

I've pushed a patch to collab/berick/opensrf-js-multipart-monkey-patch @ working to test and alleviate the issue. Note that console logging in this patch is perhaps too verbose for production use, but is needed in the short term to make sure we're capturing all the failure types.

http://git.evergreen-ils.org/?p=working/OpenSRF.git;a=shortlog;h=refs/heads/collab/berick/opensrf-js-multipart-monkey-patch

Feedback appreciated.

Revision history for this message
Bill Erickson (berick) wrote :

Also, it's possible the translator is returning malformed responses in some cases. I've looked for this on several occasions and have been unable to find any evidence of it. If that is in fact the problem and we can find evidence of it, fixing that would of course be preferable to this hack.

Revision history for this message
Dan Scott (denials) wrote :

One could also wonder about the decrepit version of XULRunner we're using as another possible suspect (more recent versions have refined XHR support).

We'll go with this hack for now; I've backported it through rel_2_0. Thanks Bill!

Dan Scott (denials)
Changed in opensrf:
status: New → Fix Committed
milestone: none → 2.1.0-alpha
Revision history for this message
Bill Erickson (berick) wrote :

Thanks Dan.

Just for the record, the problem also occurs in modern versions of Firefox.

Dan Scott (denials)
Changed in opensrf:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.