Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use BigInt for tweet IDs in client-twitter #552

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

wraitii
Copy link
Contributor

@wraitii wraitii commented Nov 23, 2024

Tweet IDs are ranging beyond JS integer support

Risks

Low. Should be a straight bug fix.

What does this PR do?

Replaces the usage of number by biting to store the lastCheckedTweetId in the twitter client.

What kind of change is this?

Bug fix

Why are we doing this? Any context or related work?

Tweet IDs are in the range of 2^60, which is more than Javascript can safely handle.

Documentation changes needed?

My changes do not require a change to the project documentation.

Testing

Running a twitter client will work but the numbers get silently rounded.
Steps:

  • Run an agent with the twitter client. Log the values of lastCheckedTweetId.

Tweet IDs are ranging beyond JS integer support
Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@wraitii wraitii changed the title Use BigInt for tweet IDs in client-twitter fix: Use BigInt for tweet IDs in client-twitter Nov 23, 2024
@yakul0

This comment was marked as abuse.

@ponderingdemocritus ponderingdemocritus merged commit 5507d36 into elizaOS:main Nov 24, 2024
1 of 2 checks passed
@wraitii wraitii deleted the bigint-for-tweet-ids branch November 24, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants