Repository navigation
Fixed - Reactive XADD ignores Spring Data Redis 4.1 options - #7428
Merged
Merged
Conversation
Signed-off-by: wn1331 <wn1331@gmail.com>
wn1331
force-pushed
the
fix/reactive-xadd-options
branch
from
November 6, 2026 05:23
0e1b646 to
989f2de
Compare
mrniko
requested changes
Nov 7, 2026
| } | ||
|
|
||
| RedisStreamCommands.TrimOptions trimOptions = options.getTrimOptions(); | ||
| if (trimOptions != null && trimOptions.hasDeletionPolicy()) { |
Member
There was a problem hiding this comment.
please join it with if (trimOptions != null below
Contributor
Author
There was a problem hiding this comment.
Done in 8bc09c8. The deletion-policy check now sits inside the existing trimOptions != null block, preserving the argument order. All three XADD regression tests and the module reactor verify pass.
| params.add("MAXLEN"); | ||
| params.add(command.getMaxlen()); | ||
| RedisStreamCommands.XAddOptions options = command.getOptions(); | ||
| if (options.isNoMkStream()) { |
Member
There was a problem hiding this comment.
add Assert.notNull(command.getOptions(), …)
Contributor
Author
There was a problem hiding this comment.
Added Assert.notNull(command.getOptions(), "Options must not be null!") in 8bc09c8, alongside the other input checks. A regression test reproduces the previous NullPointerException and verifies the IllegalArgumentException and message after the fix.
Use Maven Central for the pinned distribution, bound download waits, and extract only after a successful download in both workflows. Constraint: CodeQL failed connecting to archive.apache.org before analysis Confidence: high Scope-risk: narrow Tested: Maven archive download, SHA-512 comparison, extraction and version; installer shell syntax and workflow YAML parsing Signed-off-by: wn1331 <wn1331@gmail.com>
Validate options alongside the other command inputs and keep deletion policy and trimming serialization under one shared null guard. Constraint: Preserve XADD argument order while addressing review feedback Confidence: high Scope-risk: narrow Tested: Null-options regression failed before the guard; all three XADD tests pass after it; module reactor verify Signed-off-by: wn1331 <wn1331@gmail.com>
Member
|
Thanks for contribution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spring Data Redis 4.1 carries the complete XADD configuration in XAddOptions. RedissonReactiveStreamCommands only read the deprecated maxlen property, so NOMKSTREAM, MINID, approximate trimming, LIMIT, and stream deletion policies were ignored.
Ignoring NOMKSTREAM changed command semantics by creating a missing stream. Once NOMKSTREAM is forwarded, Redis returns a null reply for a missing stream, which also required a null-safe adapter command instead of the shared non-null StreamIdConvertor.
This change serializes the Spring Data options in Redis command order:
XADD options are validated before dereferencing them, and deletion-policy and trimming arguments share a single trim-options null guard.
Regression coverage verifies the complete argument order, rejects null options with a clear validation error, and runs NOMKSTREAM against Redis. Before the fix, the integration test created the stream and returned an ID. After the fix, it emits no ID and the stream remains absent.
Validation:
All three XADD regression tests pass with JDK 25 and Maven 3.9.16. The null-options test fails with a NullPointerException before the validation change and passes afterward. Both validation commands pass. The verify run reports zero Checkstyle violations and completes PMD, license checks, and packaging.
The failed CodeQL check timed out connecting to archive.apache.org during Maven installation, before analysis began. Both CI workflows now download the pinned Maven distribution from Maven Central, with retries and bounded timeouts, and extract only after the download succeeds.