Correct VLINKS return types - #3839
Open
hutiefang76 wants to merge 1 commit into
Open
Conversation
hutiefang76
force-pushed
the
codex/lettuce-3404-vlinks-signature
branch
from
July 11, 2026 22:11
b42cae6 to
851cbb9
Compare
VLINKS returns one collection per HNSW graph level. Preserve those levels for plain and WITHSCORES responses across all command APIs and decode both RESP2 arrays and RESP3 maps.
hutiefang76
force-pushed
the
codex/lettuce-3404-vlinks-signature
branch
from
July 11, 2026 22:25
851cbb9 to
f55d89a
Compare
Collaborator
|
Thanks @hutiefang76 |
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.
Fixes #3404
VLINKSreturns one collection per HNSW graph layer. The existing outputs flatten those layers into a single list or map, which also drops empty layers.This change:
List<List<V>>andList<Map<V, Double>>through the sync, async, cluster, and coroutine APIsFlux<List<V>>andFlux<Map<V, Double>>)Tests:
RedisVectorSetCommandBuilderUnitTests: 38 passed on JDK 8RedisVectorSetAdvancedIntegrationTests,RedisVectorSetResp2IntegrationTests, andRedisVectorSetIntegrationTests: 87 passed against Redis 8.6.2 on JDK 17Note
Medium Risk
Breaking API change on experimental vector-set commands; behavior change is intentional correctness fix with broad surface area (sync/async/reactive/cluster/Kotlin).
Overview
Fixes incorrect modeling of Redis VLINKS responses: the server returns one collection per HNSW graph layer, but Lettuce previously flattened layers into a single
ListorMapand could drop empty layers.vlinksandvlinksWithScoresnow exposeList<List<V>>andList<Map<V, Double>>across sync, async, reactive, cluster, coroutines, and API templates. Reactive APIs emitFlux<List<V>>/Flux<Map<V, Double>>(one element per layer) instead of dissolving into flat streams or a singleMono.Command decoding switches from
ValueListOutput/ValueDoubleMapOutputto newValueListListOutputandValueDoubleMapListOutput, preserving layer boundaries for RESP2 arrays and RESP3 maps. Unit tests cover layered decode, RESP3 maps, and invalid scores; integration tests were updated for the new shapes (including merging score maps per layer where assertions need flat neighbor scores).Breaking change for callers of these
@Experimentalmethods who assumed a flat list or map.Reviewed by Cursor Bugbot for commit f55d89a. Bugbot is set up for automated code reviews on this repo. Configure here.