Skip to content

Conversation

@aricart
Copy link
Member

@aricart aricart commented Oct 6, 2025

Previously, an error was thrown, but this is inconsistent on how the client handles this conditions for fetch and other similar user-initiated operations.

  • Added isNoResults method to identify "no results" error in JetStream errors.
  • Updated logic in jsm_direct.ts to stop iterators on "no results" status.
  • Enhanced tests with scenarios for handling batches and direct message retrieval when no messages are available.

Fix #335

…levant tests

- Added `isNoResults` method to identify "no results" error in JetStream errors.
- Updated logic in `jsm_direct.ts` to stop iterators on "no results" status.
- Enhanced tests with scenarios for handling batches and direct message retrieval when no messages are available.

Signed-off-by: Alberto Ricart <[email protected]>
Copy link

@scottf scottf left a comment

Choose a reason for hiding this comment

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

LGTM

@aricart aricart merged commit 79138d4 into main Oct 6, 2025
37 of 38 checks passed
@aricart aricart deleted the fix-335 branch October 6, 2025 16:03
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.

direct batch: throws "no results" when no messages match the request

3 participants