Skip to content

Avoid getLastMessageId RPC when calling hasMessageAvailable after seek by timestamp #491

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented May 27, 2025

Motivation

#422 introduces a regression that hasSoughtByTimestamp_ is never set back to false after the seek operation is done. Then, getLastMessageIdAsync will always be called even if lastDequedMessageId_ is not earliest, which means no messages have been received.

Modifications

  • Check if incomingMessages_ is not empty in case messages are never received by the caller but they are already cached.
  • Update testHasMessageAvailableAfterSeekTimestamp to cover the change

@BewareMyPower BewareMyPower force-pushed the bewaremypower/fix-has-message-available-regression branch from 89432d2 to 8c3bc71 Compare May 28, 2025 09:57
@BewareMyPower BewareMyPower changed the title Reduce unnecessary getLastMessageId RPC in hasMessageAvailable Avoid getLastMessageId RPC when calling hasMessageAvailable after seek by timestamp May 28, 2025
@BewareMyPower BewareMyPower marked this pull request as ready for review May 28, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant