Closed Bug 955263 Opened 10 years ago Closed 10 years ago

Twitter parse error after reconnect caused by a stream error

Categories

(Chat Core :: Twitter, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aleth, Assigned: aleth)

Details

Attachments

(1 file)

*** Original post on bio 1830 at 2012-11-27 19:40:00 UTC ***

Error: SyntaxError: JSON.parse: unexpected character while parsing <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Error 503 Server overloaded, try again in a few seconds.</title>
</head>
<body>
<h2>HTTP ERROR: 503</h2>
<p>Problem accessing '/2/user.json'. Reason:
<pre>    Server overloaded, try again in a few seconds.</pre>
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
</body>
</html>
{"friends":[388667346,88662134,138793042,19811190,17451841,91143053,19285268,259489253,265918885,15234407,17522956,7440452,390039185,38385999,15659603,15473958,22706835,149709927,91815273,17006157,59917973,85325508,92522167,290974709]}
Source File: jar:file://instantbird/omni.ja!/components/twitter.js
Line: 744
Source Code:
twitter
*** Original post on bio 1830 at 2012-11-27 22:27:45 UTC ***

flo mentioned on IRC that some API calls return errors in JSON and some in HTML, in ways that seem difficult to predict. Here we receive a HTML error message via the stream API (onDataAvailable()). We currently just throw a parse error and continue (no disconnect). 

The parse error was preceded by an error: 503 - Service Unavailable
File: resource:///modules/http.jsm
Line: 52
which will have been reported properly to the account manager, followed by a disconnect/reconnect.

It seems likely that the HTML error message to the stream was sent after reconnect, but I don't have logs.

I don't think there is anything more we can sensibly do here (unless maybe it happens again when better logging is available ;) and it turns out we can).
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
*** Original post on bio 1830 at 2012-11-27 23:06:16 UTC ***

Actually turns out to be due to this._pendingData not being cleared on disconnect.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Attached patch PatchSplinter Review
*** Original post on bio 1830 as attmnt 2139 at 2012-11-28 15:54:00 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8353901 - Flags: review?(florian)
Assignee: nobody → aleth
Status: REOPENED → ASSIGNED
Summary: Parse error on twitter 503 error message → Twitter parse error afd 503 error message
Summary: Twitter parse error afd 503 error message → Twitter parse error after reconnect caused by 503
Comment on attachment 8353901 [details] [diff] [review]
Patch

*** Original change on bio 1830 attmnt 2139 at 2012-11-28 22:39:41 UTC ***

Thanks!
Attachment #8353901 - Flags: review?(florian) → review+
Summary: Twitter parse error after reconnect caused by 503 → Twitter parse error after reconnect caused by a stream error
*** Original post on bio 1830 at 2012-11-29 00:08:43 UTC ***

Committed as http://hg.instantbird.org/instantbird/rev/82aeafd48d80
Status: ASSIGNED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.4
You need to log in before you can comment on or make changes to this bug.