Skip to content

feat(jetstream): handle "no results" status in direct APIs - #336

Merged
aricart merged 1 commit into
mainfrom
fix-335
Oct 6, 2025
Merged

aricart merged 1 commit into
mainfrom
fix-335

Conversation

@aricart

@aricart aricart commented Oct 6, 2025 •

Copy link
Copy Markdown
Member

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 <alberto@synadia.com>

@scottf scottf left a comment

Copy link
Copy Markdown

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
9 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

2 participants