镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

DOC-7267 Clean up the NRedisStack sync and async entries - #4499

Open
andy-stark-redis wants to merge 1 commit into
mainfrom
DOC-7267-nredisstack-leftovers
Open

andy-stark-redis wants to merge 1 commit into
mainfrom
DOC-7267-nredisstack-leftovers

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The remaining NRedisStack items from DOC-7267, found by checking every entry against NRedisStack 1.8.0 and StackExchange.Redis 3.4.31 by reflection. 152 command files change. No other client's key changes, and the only status-file change is SUBSTR.

  • Removed from the nredisstack_* lists:
    • 30 expression-text entries (lines copied out of method bodies, return type return, params typed Any).
    • 16 ...Async-named entries sitting in sync lists, each with a sync twin already present.
    • 4 GetRange(double value, Exclude exclude, bool isStart) entries, a private sorted-set helper that GETRANGE and SUBSTR had picked up.
    • 3 async HSCAN, SSCAN and ZSCAN entries that were the synchronous four-argument overload.
    • 325 exact duplicates inside one list, up to three copies of one signature.
  • Replaced KEYS and SCAN with IServer.Keys(int database = -1, ...) and KeysAsync. The old entries had no database parameter, and no Scan method exists. SUBSTR has no library method, so its lists are empty and the status file marks both as generic_only.
  • Added 37 async entries for the 30 commands that had a sync list and no async key: the 7 blocking list and sorted-set pops (NRedisStack extension methods) and the 23 JSON.* commands. Each takes its sync entry's params and descriptions, and every one matches a method on the released assembly by parameter names and types.
  • JSON.GET's sync return type public T? becomes T?.

Review notes

  • Most of the diff is the 325 duplicates. The merged data/command-api-mapping.json equals a fresh regeneration from the per-command files.
  • SHUTDOWN, one of the commands I had counted as missing an async key, is already unsupported for nredisstack_async in the status file, because SE.Redis has no ShutdownAsync.
  • Built with content/develop/clients ignored (the full site only builds in CI). BLPOP async, GET sync, KEYS async, and SUBSTR sync and async render as expected.
  • Not fixed, and flagged in the commit:
    • Overload selection per command was not reviewed (INCRBYFLOAT still lists the long overload, HINCRBY lists HashDecrement).
    • JSON.SET lists only the RedisValue overload, not the object overload or the fpha parameter.
    • Scan entries still show RedisBase.CursorUtils.DefaultLibraryPageSize instead of 250.
    • 119 async entries in 105 files still carry a return-type prefix in the signature (for example Task<bool> AddAsync(...)), while others do not.

🤖 Generated with Claude Code


Note

Low Risk
Touched files are generated documentation/JSON only; risk is mis-documented API surface for readers, not runtime or security behavior.

Overview
Aligns the per-command JSON under data/command-api-mapping/ with NRedisStack (reflection against shipped assemblies): strips hundreds of duplicate nredisstack_sync / nredisstack_async blocks, removes bad scrapes (e.g. body snippets with Any/return, Async overloads in sync-only lists, misplaced helpers such as private GetRange on string commands, and redundant geo/hash/string overloads).

Adds missing nredisstack_async signatures where only sync existed—blocking list/sorted-set commands (BLPOP, BRPOP, BLMOVE-related moves, BLMPOP, BZMPOP, BZPOPMAX/BZPOPMIN, BRPOPLPUSH) and JSON.ARRLEN (ArrLenAsync)—with typed parameters and task return types.

Status: command-api-mapping-status.json now records SUBSTR for NRedisStack sync/async as generic_only (no dedicated library methods).

Other clients’ mappings in the diff are unchanged aside from these cleanups; known gaps (overload choice, some SCAN defaults, etc.) are called out in the PR description.

Reviewed by Cursor Bugbot for commit 5a4c5e9. Bugbot is set up for automated code reviews on this repo. Configure here.

The sweep behind #4482 and #4476 left four kinds of defect in the nredisstack lists, found by
checking each entry against NRedisStack 1.8.0 and StackExchange.Redis 3.4.31 by reflection.
152 command files change; no other client key and only SUBSTR in the status file.

Removed: 30 expression-text entries, lines copied out of method bodies such as
StringIncrement(key, -value, flags) with return type "return" and every param typed Any (INCR,
INCRBY, INCRBYFLOAT, GET, HINCRBYFLOAT, ZINCRBY, ZREM, JSON.SET and the blocking list commands);
16 Async-named entries that had landed in sync lists (BITCOUNT, BITOP, GEODIST, SETBIT and
others, each with a sync twin already present); 4 GetRange(double value, Exclude exclude,
bool isStart) entries, a private sorted-set helper that GETRANGE and SUBSTR had picked up; 3
async HSCAN, SSCAN and ZSCAN entries that were the synchronous four-argument overload under its
sync name; and 325 exact duplicates inside a single list, up to three copies of one signature.

Replaced: KEYS and SCAN described a Keys(pattern, pageSize, cursor, pageOffset, flags) with no
database parameter and an async twin that was not named KeysAsync. The method is IServer.Keys
(database = -1 first), which issues KEYS or SCAN depending on the server, and the async form is
KeysAsync returning IAsyncEnumerable. Both now say so. SUBSTR had only the helper entry, and
neither library has a SUBSTR method, so its two lists are empty and the status file marks both
generic_only.

Added: 37 async entries for the 30 commands that had a sync list and no async key, the 7
blocking list and sorted-set pops (BLPopAsync and the others, which are NRedisStack extension
methods on IDatabase) and the 23 JSON.* commands (IJsonCommandsAsync). Each takes its sync
entry's params and descriptions with Async added to the name, and every one matches a method on
the released assembly by parameter names and types. JSON.GET's sync return type "public T?" is
now "T?".

Learned: copying entries by list index let a sync list absorb async entries and an async list absorb sync ones, so check names and duplicates after any bulk rewrite
Constraint: IServer.Keys is the only SE.Redis method for KEYS and SCAN, there is no Scan method
Directive: do not list a private helper or a line copied from a method body as an API entry, check the entry against the released assembly
Gaps: overload selection per command was not reviewed (INCRBYFLOAT still lists the long overload, HINCRBY lists HashDecrement)
Gaps: JSON.SET lists only the RedisValue overload, not the object overload or the fpha parameter that 1.8.0 has
Gaps: scan entries still show the source default RedisBase.CursorUtils.DefaultLibraryPageSize instead of 250
Recheck: when NRedisStack ships a release after 1.8.0, rerun the reflection check
Ticket: DOC-7267
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7267

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at 5a4c5e9

@dwdougherty dwdougherty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved.

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.

2 participants