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/duplicate next tweet log #1401

Closed

Conversation

jasonqindev
Copy link
Contributor

  • Resolved an issue where generateNewTweetLoop was called twice in the start method of /packages/client-twitter/src/post.ts.
  • The method was invoked at line 174 and line 190 without any conditional checks, leading to two independent tweet scheduling loops being created.
  • Move second generateNewTweetLoop() inside the if (enableActionProcessing)

Fixes #1395

Relates to:

Issue #1395

Risks

Low: Removing the redundant call ensures only one scheduling loop, minimal impact on other functionalities.

Background

What does this PR do?

This PR fixes an issue where generateNewTweetLoop was called twice, leading multiple tweets to be posted. It ensures only a single scheduling loop is initialized by removing the redundant call.

What kind of change is this?

Bug fixes (non-breaking change which fixes an issue)

Documentation changes needed?

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

Testing

Where should a reviewer start?

Start by reviewing the start method in /packages/client-twitter/src/post.ts, focusing on the moving second generateNewTweetLoop() inside the if (enableActionProcessing) condition.

Detailed testing steps

  1. Configure the Twitter client and set POST_IMMEDIATELY=true to enable immediate tweet posting.
  2. Start the service and observe if two tweets are sent, and check if the log contains multiple Next tweet scheduled in xxx minutes messages.
  3. Verify that after starting the service, only one tweet is sent and the Next tweet scheduled in xxx minutes message is logged only once.
  4. Confirm that tweets are still being scheduled correctly without any issues.

jasonqindev and others added 4 commits December 23, 2024 16:26
- Resolved an issue where `generateNewTweetLoop` was called twice in the `start` method of /packages/client-twitter/src/post.ts.\n- The method was invoked at line 174 and line 190 without any conditional checks, leading to two independent tweet scheduling loops being created.\n- Removed one of the redundant `generateNewTweetLoop` calls to ensure only a single scheduling loop is initialized.\n\nFixes elizaOS#1395
@jasonqindev
Copy link
Contributor Author

The PR I previously created was merged into the main branch and has been closed, which was incorrect. I have created a new PR to merge into the develop branch.

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.

1 participant