Skip to content

Commit b284942

Browse files
Merge pull request #52 from Giveth/revert-social-values
check isLoggedIn
2 parents fe90ccf + 250fc56 commit b284942

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/modules/social-media/services/twitter.service.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)