Twitter cron updates die at max length

dsantangelo - September 5, 2008 - 00:16
Project:Activity Stream
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Drupal 5 defaults to a title length of 128 characters. Tweets, however, can be 140 characters long. As a consequence, the following comparison:

$source_changed = ($node->title == $activity['title'] && $node->body == $activity['body']) ? false : true;

will always fail when tweet length is 129-140 characters and the default title length in Drupal has not been altered.

I've witnessed a few problems this creates; cron seems to act erratically when this condition is present: the same Tweet node is updated over and over (check watchdog!), cron will run indefinitely, new Tweets aren't saved, and so forth.

Patch attached.

AttachmentSize
activitystream.module.patch657 bytes

#1

akalsey - September 5, 2008 - 12:36

If text is appended to the title legitimately, this patch doesn't do the job.

If someone has a stream item with a title "My Item" and changes the source title to "My Item (updated)" then this patch will still assume the item hasn't changed. However, it's likely that if that sort of change occurs the body has also been updated.

I suppose it's rare that a title will be updated, will be the only thing updated, and will have the same initial characters and only additions. The only use case I can think of would be if I had a typo in the title and left off a character or two. Then I might add characters to the title and change nothing else.

#2

akalsey - April 12, 2009 - 17:58
Version:5.x-1.x-dev» 6.x-2.x-dev
Status:needs review» fixed

Patch applied to 6.x-2.x-dev

#3

System Message - April 26, 2009 - 18:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.