Skip to content

Commit

Permalink
Merge pull request #630 from Rishikant181/stack
Browse files Browse the repository at this point in the history
Fixed "Maximum call stack exceeded" error while deserializing tweet(s) with quoted
  • Loading branch information
Rishikant181 authored Oct 17, 2024
2 parents 8cc290f + 05dfcc0 commit a3e8830
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rettiwt-api",
"version": "4.1.2",
"version": "4.1.3",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"description": "An API for fetching data from TwitterAPI, without any rate limits!",
Expand Down
14 changes: 1 addition & 13 deletions src/models/data/Tweet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,10 @@ export class Tweet {
}
// If normal tweet
else if (tweet.quoted_status_result && Object.entries(tweet.quoted_status_result).length) {
return new Tweet(tweet);
return new Tweet(tweet.quoted_status_result.result as ITweet);
}
// Else, skip
else {
// Logging
LogService.log(ELogActions.WARNING, {
action: ELogActions.DESERIALIZE,
message: 'Quoted tweet not found, skipping',
});

return undefined;
}
}
Expand All @@ -137,12 +131,6 @@ export class Tweet {
}
// Else, skip
else {
// Logging
LogService.log(ELogActions.WARNING, {
action: ELogActions.DESERIALIZE,
message: 'Retweeted tweet not found, skipping',
});

return undefined;
}
}
Expand Down

0 comments on commit a3e8830

Please sign in to comment.