File tree Expand file tree Collapse file tree
src/modules/social-media/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1107,6 +1107,20 @@ export class TwitterService {
11071107 `${ username } - Starting incremental tweet scraping with max ${ this . maxTweetsToCollect } iterations` ,
11081108 ) ;
11091109
1110+ // Verify authentication status immediately before creating iterator
1111+ const isLoggedIn = await this . scraper . isLoggedIn ( ) ;
1112+ if ( ! isLoggedIn ) {
1113+ this . logger . error (
1114+ `${ username } - Authentication failed before iterator creation. Aborting fetch.` ,
1115+ ) ;
1116+ return [ ] ;
1117+ }
1118+
1119+ // TODO: Remove after fixing the social media data not updating issue
1120+ this . logger . log (
1121+ `${ username } - Authentication verified, creating iterator...` ,
1122+ ) ;
1123+
11101124 const tweetIterator = this . scraper . getTweets (
11111125 username ,
11121126 this . maxTweetsToCollect ,
You can’t perform that action at this time.
0 commit comments