You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using sitestreams, sometimes messages are split over multiple lines (possibly in userstreams too - I don't know?).
There's a few changes that need to be made to handle split lines with this library, but I wanted to point out a non-obvious one.
If a message is split, the split can be anywhere in the message content. Sometimes this means a space from the message is at the start or end of a split line.
The parse_stream_line method starts out by calling ln.strip! with the intention of removing the leading newline. This is problematic, as it also removes the leading or trailing space when they should be there in split lines, causing data corruption.
Changing ln.strip! to ln[0] = '' resolves the issue - but you probably also want to update later checks for ln.empty? as the heartbeat signals from Twitter will now look like "\n" instead of being empty strings (or something similar to this..).
The text was updated successfully, but these errors were encountered:
Using sitestreams, sometimes messages are split over multiple lines (possibly in userstreams too - I don't know?).
There's a few changes that need to be made to handle split lines with this library, but I wanted to point out a non-obvious one.
If a message is split, the split can be anywhere in the message content. Sometimes this means a space from the message is at the start or end of a split line.
The parse_stream_line method starts out by calling
ln.strip!
with the intention of removing the leading newline. This is problematic, as it also removes the leading or trailing space when they should be there in split lines, causing data corruption.Changing
ln.strip!
toln[0] = ''
resolves the issue - but you probably also want to update later checks for ln.empty? as the heartbeat signals from Twitter will now look like "\n" instead of being empty strings (or something similar to this..).The text was updated successfully, but these errors were encountered: