lyricat / Hotot

A Twitter Client
http://hotot.org
GNU Lesser General Public License v3.0
482 stars 130 forks source link

Hotot Stream Parsing Problem #473

Open tante opened 11 years ago

tante commented 11 years ago

Since I upgraded my Machine to fedora18 beta Hotot (built and installed from a git clone) doesn't work properly. The UI and everything works but the autoupdates seem to fail. Here's an example from the debug stream:

[Streams XHR] JSON Parse error: Unterminated string {"created_at":"Mon Dec 10 13:59:04 +0000 2012","id":278136756514213888,"id_str":"278136756514213888","te [Streams XHR] JSON Parse error: Unexpected identifier "xt" xt":"If people are going to refer to OSes by code names (Quasi Quail, Snow Lemur, etc.), then that name better show up in ALL version dialogs.","source":"\u003ca href=\"http:\/\/suso.suso.org\/xulu\/Command_Line_Magic\" rel=\"nofollow\"\u003eCLI Magic poster\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":,{"id":91333167,"id_str":"91333167","name":"Command Line Magic","screen_name":"climagic","location":"BASHLAND","url":"http:\/\/www.climagic.org\/","description":"Cool Unix\/Linux Command Line tricks you can use in 140 characters or less. ","protected":false,"followers_count":23732,"friends_count":9038,"listed_count":897,"created_at":"Fri Nov 20 12:49:35 +0000 2009","favourites_count":25,"utc_offset":0,"time_zone":"London","geo_enabled":false,"verified":false,"statuses_count":5416,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/60122174\/checkertermbackground.png","profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/60122174\/checkertermbackground.png","profile_background_tile":true,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/535876218\/climagic-icon_normal.png","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/535876218\/climagic-icon_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"entities":{"hashtags":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},

For some reason the parser splits the JSON stream into unparseable pieces. If I refresh manually all current status messages are fine but again it does not longer update but breaks tweets.

katanacrimson commented 11 years ago

protip: when posting blocks of code and such, indent each "line" with four spaces. github will mark it as a code block and make it easier to read.

toketin commented 11 years ago

Same here for me, i'm using Hotot version 0.9.8.10 but i had this issue also in previous versions. If i push "r" in hotot the stream gets update but the auto-update function doesn't work. I hope you'll fix it, because i haven't found any information about here or online.

tante commented 11 years ago

Problem still exists with current git master 682b369.

I looked a a few of the broken strings and there seems to be no detectable rule for when those things get broken to pieces, no character limit or character they always stumble over.

What kind of JSON Parsing library is used?

tante commented 11 years ago

The problem is in data/js/lib.twitter.js in lines 844-890 for some reason the "onreadystatechange" function fires while there is still data coming.

@toketin are you running the gtk client on Linux?

toketin commented 11 years ago

Yes, in archlinux, i've tried both gtk2, gtk3 and qt client.

2013/2/27 Jürgen Geuter notifications@github.com

The problem is in data/js/lib.twitter.js in lines 844-890 for some reason the "onreadystatechange" function fires while there is still data coming.

@toketin https://github.com/toketin are you running the gtk client on Linux?

— Reply to this email directly or view it on GitHubhttps://github.com/lyricat/Hotot/issues/473#issuecomment-14172293 .

tante commented 11 years ago

This pull request https://github.com/lyricat/Hotot/pull/523 should fix the issue. @toketin care to test?

katanacrimson commented 11 years ago

fwiw, I noticed twit does it this way:

https://github.com/ttezel/twit/blob/master/lib/parser.js

While it's made for nodejs, it still might be useful.

toketin commented 11 years ago

Have you tried to apply it into hotot code?

2013/2/27 Damian Bushong notifications@github.com

fwiw, I noticed twit does it this way:

https://github.com/ttezel/twit/blob/master/lib/parser.js

While it's made for nodejs, it still might be useful.

— Reply to this email directly or view it on GitHubhttps://github.com/lyricat/Hotot/issues/473#issuecomment-14173320 .