Closed PatrickKennedy closed 8 months ago
Let me know if there's any more info needed, thanks!
Well what context does it appear in?
Well what context does it appear in?
Different person, same issue. For me it seems to occur mostly in the context of the home and profile timelines.
same issue, occurs primarily in qrts from what i've noticed
{
"entryType": "TimelineTimelineItem",
"__typename": "TimelineTimelineItem",
"itemContent": {
"itemType": "TimelineTweet",
"__typename": "TimelineTweet",
"tweet_results": {
"result": {
"__typename": "Tweet",
"rest_id": "1718160087640895695",
"core": {
"user_results": {
"result": {
"__typename": "User",
"id": "VXNlcjoxNTY3NjE5OTI4NTQyMzk2NDE3",
"rest_id": "1567619928542396417",
"affiliates_highlighted_label": {},
"has_graduated_access": true,
"is_blue_verified": false,
"profile_image_shape": "Circle",
"legacy": {
"can_dm": true,
"can_media_tag": true,
"created_at": "Wed Sep 07 21:05:16 +0000 2022",
"default_profile": true,
"default_profile_image": false,
"description": "queer ace transfemme communist (she/they)\nBoD @HarmReduction // queer & harm reduction lege activist\n@gaynarcan@girlcock.club // @ket.bsky.social",
"entities": {
"description": {
"urls": []
}
},
"fast_followers_count": 0,
"favourites_count": 41990,
"followers_count": 1266,
"friends_count": 2267,
"has_custom_timelines": true,
"is_translator": false,
"listed_count": 18,
"location": "New Orleans, Louisiana, US",
"media_count": 599,
"name": "Corinne Green",
"normal_followers_count": 1266,
"pinned_tweet_ids_str": [],
"possibly_sensitive": false,
"profile_banner_url": "https://pbs.twimg.com/profile_banners/1567619928542396417/1679947505",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1567620925041922050/qEEsYcKB_normal.jpg",
"profile_interstitial_type": "",
"screen_name": "gaynarcan",
"statuses_count": 7481,
"translator_type": "none",
"verified": false,
"want_retweets": false,
"withheld_in_countries": []
}
}
}
},
"unmention_data": {},
"edit_control": {
"edit_tweet_ids": [
"1718160087640895695"
],
"editable_until_msecs": "1698479861000",
"is_edit_eligible": true,
"edits_remaining": "5"
},
"is_translatable": false,
"views": {
"count": "692",
"state": "EnabledWithCount"
},
"source": "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>",
"quoted_status_result": {},
"legacy": {
"bookmark_count": 1,
"bookmarked": false,
"created_at": "Sat Oct 28 06:57:41 +0000 2023",
"conversation_id_str": "1718160087640895695",
"display_text_range": [
0,
119
],
"entities": {
"user_mentions": [],
"urls": [],
"hashtags": [],
"symbols": []
},
"favorite_count": 20,
"favorited": false,
"full_text": "if you are american you are morally obligated to watch this. all three minutes. you don't need subtitles to understand.",
"is_quote_status": true,
"lang": "en",
"quote_count": 0,
"quoted_status_id_str": "1718146972144570678",
"quoted_status_permalink": {
"url": "https://t.co/fbK4xvuHtM",
"expanded": "https://twitter.com/Sarah_Hassan94/status/1718146972144570678",
"display": "twitter.com/Sarah_Hassan94…"
},
"reply_count": 2,
"retweet_count": 13,
"retweeted": false,
"user_id_str": "1567619928542396417",
"id_str": "1718160087640895695"
}
}
},
"tweetDisplayType": "Tweet"
},
"feedbackInfo": {
"feedbackKeys": [
"1060665035"
]
},
"clientEventInfo": {
"component": "result",
"element": "tweet",
"details": {
"timelinesDetails": {
"controllerData": "DAACDAAFDAABDAABDAABCgABAAAAAAAAAAAAAAwAAgoAAQAAAAAAAAAACgACyojezDxwbv8KAAUfQwjfXo7yoQgABgAAAAAKAAfJAtVV14BZvAAAAAAA"
}
}
}
}
I think I've been seeing this in searches and hashtag clicks... @kheina could you take a look please?
Ok I've figured out the problem causing this error. Occasionally the tweet object used in ParseTimelineTweet
will have a quoted_status_result
property that is an empty Object, which means that the following call to handleTweetObject
has undefined
as the first parameter.
https://github.com/kheina-com/Blue-Blocker/blob/f6db6561f89b8f3c29a9a181b6d81534208eab09/src/parsers/instructions.ts#L98-L102
The error occurs in handleTweetObject
, because undefined
does not have a hasOwnProperty
property (ironic isn't it)
https://github.com/kheina-com/Blue-Blocker/blob/f6db6561f89b8f3c29a9a181b6d81534208eab09/src/parsers/instructions.ts#L69
The fix would be to validate if quoted_status_result.result
exists here:
https://github.com/kheina-com/Blue-Blocker/blob/f6db6561f89b8f3c29a9a181b6d81534208eab09/src/parsers/instructions.ts#L97
Would probably be a good idea to do the same check here, just in case:
https://github.com/kheina-com/Blue-Blocker/blob/f6db6561f89b8f3c29a9a181b6d81534208eab09/src/parsers/instructions.ts#L103
@kheina seems to have gone inactive unfortunately, but I have made the necessary changes in #215
ok so 4ddc965 ought to fix this (I haven't tested yet myself to confirm, though)
Got this error, though it doesn't seem fatal so that's a plus! Let me know if there's any more info needed, thanks! (I'm up to 3k blocked, so needless to say I reeeeally appreciate this!)
"[Blue Blocker] found unexpected tweet shape: "