Closed Bug 955101 Opened 11 years ago Closed 11 years ago

Truncated RTs don't always show the full original tweet

Categories

(Chat Core :: Twitter, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aleth, Assigned: aleth)

Details

Attachments

(1 file, 1 obsolete file)

*** Original post on bio 1672 at 2012-08-26 19:30:00 UTC ***

This is due to the truncated flag on RTs generally not being set to true when a RT is too long, contrary to the twitter API documentation. There is a twitter bug report on this here https://dev.twitter.com/issues/37, with the comment "The truncated field is now rarely, if ever, used. The tweet has not been truncated as the original status is preserved within the retweeted_status node.".
Attached patch Patch (obsolete) — Splinter Review
*** Original post on bio 1672 as attmnt 1848 at 2012-08-26 19:34:00 UTC ***

Checks for tweet length == 140 and tweet text ending in an ellipsis instead of testing the truncated flag.

An alternative option would be to not even check for that and simply to always append the original tweet as soon as retweeted_status is set, i.e. even when it is not necessary.
Attachment #8353607 - Flags: review?(clokep)
Assignee: nobody → aleth
Status: NEW → ASSIGNED
Comment on attachment 8353607 [details] [diff] [review]
Patch

*** Original change on bio 1672 attmnt 1848 at 2012-08-26 19:52:00 UTC ***

>diff --git a/components/twitter.js b/components/twitter.js

>+        text.substr(-3) == "...") {

I dislike this test, there's no guarantee that twitter won't change the ellipsis to the ... character someday.
Attachment #8353607 - Flags: review?(clokep) → review-
Attached patch PatchSplinter Review
*** Original post on bio 1672 as attmnt 1849 at 2012-08-26 19:55:00 UTC ***

Alright, lets go with the alternative option then!
Attachment #8353608 - Flags: review?(clokep)
Comment on attachment 8353607 [details] [diff] [review]
Patch

*** Original change on bio 1672 attmnt 1848 at 2012-08-26 19:55:09 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8353607 - Attachment is obsolete: true
*** Original post on bio 1672 at 2012-08-26 19:56:12 UTC ***

Would comparing text.slice(text.indexOf(": ") with retweet.text be reliable?

(In reply to comment #2)
> I dislike this test, there's no guarantee that twitter won't change the
> ellipsis to the ... character someday.

And also no guarantee that "..." isn't the normal end of the retweeted tweet.
*** Original post on bio 1672 at 2012-08-26 20:00:40 UTC ***

(In reply to comment #3)
> Created attachment 8353608 [details] [diff] [review] (bio-attmnt 1849) [details]
> Patch
> 
> Alright, lets go with the alternative option then!

I'll let Patrick look at it too, but fwiw, I'm OK with this patch, so I guess you can ignore comment 4, except if you would prefer a stricter test.
Comment on attachment 8353608 [details] [diff] [review]
Patch

*** Original change on bio 1672 attmnt 1849 at 2012-08-26 20:04:20 UTC ***

I don't see any reason to not always use the status from the retweeted_status.
Attachment #8353608 - Flags: review?(clokep) → review+
Whiteboard: [checkin-needed]
*** Original post on bio 1672 at 2012-08-28 00:55:42 UTC ***

Committed as http://hg.instantbird.org/instantbird/rev/bcdc25b745ad
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [checkin-needed]
Target Milestone: --- → 1.3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: