Bug 37076

Summary: Omits part of the room member list on #telepathy
Product: Telepathy Reporter: Will Thompson <will>
Component: idleAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED MOVED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: will
Version: git masterKeywords: patch
Hardware: Other   
OS: All   
URL: http://cgit.freedesktop.org/~wjt/telepathy-idle/log/?h=handle-massive-lines
Whiteboard:
i915 platform: i915 features:

Description Will Thompson 2011-05-10 10:25:55 UTC
I noticed today that the userlist in #telepathy was incomplete. From looking at the protocol logs, it looks like the list of members arrives in two batches, and Idle only exposes the first batch in the Telepathy API.

I don't have the logs because I closed the terminal by accident and I'm going home. :)
Comment 1 Will Thompson 2011-05-11 03:42:31 UTC
This is because Freenode sends more than 512 characters in a single line, and the Idle parser … splits up such messages and tries to parse the subsequent chunks as stand-alone messages … which cannot possibly work. :)

Test case coming up. I think the fix is for Idle to just malloc a buffer big enough to hold the message, and damn the consequences.
Comment 2 Will Thompson 2011-05-11 11:43:15 UTC
I'm now not 100% sure that this was Freenode's fault: I can't reproduce it sending lines longer than 512 bytes. I've got a branch that replaces the buffering code with some code that doesn't care about line lengths and also is less convoluted: <http://cgit.collabora.co.uk/git/user/wjt/telepathy-idle-wjt.git/log/?h=handle-massive-lines>

But I'm not really sure it's okay: I won't be comfortable merging it until I know for sure what was causing the issue before, that there's a C unit test to test the parser in a variety of ways, and so on.
Comment 3 Debarshi Ray 2011-08-18 18:40:32 UTC
For some reason I am unable to reproduce with Freenode right now. I tried #fedora-devel and #telepathy.
Comment 4 Will Thompson 2011-11-10 08:04:37 UTC
So I've just updated this branch. A coworker (who I believe was using Idle) lost a message which I (using irssi, luddite that I am) saw truncated. I suspect it's to do with the input-splitting code just dropping over-long lines, which this branch does fix.
Comment 5 Will Thompson 2011-11-10 08:06:13 UTC
Ah, I think this code might break if it happens to get a chunk of data which ends with '\r' and then another chunk which starts with '\n'. Pesky code.
Comment 6 Simon McVittie 2013-09-05 12:44:02 UTC
Will, do you still have a copy of this branch somewhere?
Comment 7 Will Thompson 2013-09-05 13:17:28 UTC
This updated URL should spring to life next time the cron job runs on Annarchy.
Comment 8 GitLab Migration User 2019-12-03 20:09:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-idle/issues/28.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.