kheina-com / Blue-Blocker

Blocks all Twitter Blue verified users on twitter.com
Mozilla Public License 2.0
326 stars 29 forks source link

Could not parse tweet: Tombstone #219

Closed rougetimelord closed 6 months ago

rougetimelord commented 7 months ago

If the extension gets an API response with type: TweetTombstone the object gets passed to handleTweetObject which gracefully fails here: https://github.com/kheina-com/Blue-Blocker/blob/d301118d32d5bef801c47df025dfd54857a95174/src/parsers/instructions.ts#L73

The TweetTombstone object looks like this:

{
    "__typename": "TweetTombstone",
    "tombstone": {
        "__typename": "TextTombstone",
        "text": {
            "rtl": false,
            "text": "You’re unable to view this Post because this account owner limits who can view their Posts. Learn more",
            "entities": [
                {
                    "fromIndex": 92,
                    "toIndex": 102,
                    "ref": {
                        "type": "TimelineUrl",
                        "url": "https://help.twitter.com/rules-and-policies/notices-on-twitter",
                        "urlType": "ExternalUrl"
                    }
                }
            ]
        }
    }
}
rougetimelord commented 7 months ago

Feel free to assign this issue to me, I'm working on a fix right now and just wanted an issue number to reference.

Further research notes: the tombstone object can sneak past this check by being embedded as a quoted status. https://github.com/kheina-com/Blue-Blocker/blob/d301118d32d5bef801c47df025dfd54857a95174/src/parsers/instructions.ts#L82-L84 So we have to check in handleTweetObject.

cooljeanius commented 7 months ago

Feel free to assign this issue to me, I'm working on a fix right now and just wanted an issue number to reference.

OK, done.