Skip to content

Conversation

@i18nsite
Copy link
Contributor

@i18nsite i18nsite commented Dec 1, 2025

English / 中文

English

Issue: #3276

Description:
This PR adds support for exclusive ranges in the XPENDING command, allowing users to specify exclusive start and end IDs using the ( prefix, similar to XRANGE and XREVRANGE.

  • Modified StreamPendingOptions to include exclude_start and exclude_end flags.
  • Updated CommandXPending::Parse to detect the ( prefix in start_id and end_id arguments.
  • Updated Stream::GetPendingEntries to correctly filter entries based on the exclusion flags.
  • Added comprehensive Go tests to verify the exclusive range functionality.

中文

Issue: #3276

描述:
本 PR 为 XPENDING 命令添加了对排他范围的支持,允许用户使用 ( 前缀指定排他的起始和结束 ID,类似于 XRANGEXREVRANGE

  • 修改了 StreamPendingOptions,增加了 exclude_startexclude_end 标志。
  • 更新了 CommandXPending::Parse,以检测 start_idend_id 参数中的 ( 前缀。
  • 更新了 Stream::GetPendingEntries,根据排他标志正确过滤条目。
  • 添加了全面的 Go 测试以验证排他范围功能。

@PragmaTwice PragmaTwice changed the title feat(stream): support exclusive range for XPENDING command (#3276) feat(stream): support exclusive range for XPENDING command Dec 1, 2025
The XPENDING command was incorrectly using the start_id instead of the end_id
when parsing the range arguments. This caused incorrect filtering of pending
entries when a range was specified.

This commit fixes the issue by passing the correct end_id to the
ParseStreamEntryID function.
This commit adds support for exclusive ranges in the XPENDING command
using the  prefix for start and end IDs, similar to XRANGE.

- Modified  to include  and  flags.
- Updated  to handle  prefix.
- Updated  to filter entries based on exclusion flags.
- Added Go tests to verify exclusive range behavior.
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.

3 participants