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

feat: implement an exponential-backoff to find echo message #747

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

medtaher123
Copy link
Contributor

@medtaher123 medtaher123 commented Feb 12, 2025

This PR introduces exponential backoff when checking for existing messages to prevent duplicate echo messages. Previously, echo messages could arrive before the original message was saved, causing them to be incorrectly treated as new messages.

Changes:

  • Implemented retry logic with exponential backoff in findMessageWithRetries().
  • Instead of immediately assuming an echo message is new, the system retries checking for its existence with increasing delay.

Behavior:

  1. When an echo message arrives, the system checks if the message exists.
  2. If not found, it waits and retries multiple times (default: 5 attempts, doubling the delay each time).
  3. If still not found after all retries, it is treated as an external echo.

serves Issue #746

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