Fix ZRangeArgs Start/Stop ordering for BYSCORE REV in GetWorkflowInstances - #480
Merged
cschleiden merged 4 commits intoJun 5, 2026
Merged
Conversation
…ances go-redis v9.19.0 removed the silent Start/Stop swap for ZRANGE BYSCORE REV. With Rev: true, Redis requires Start >= Stop (high to low). Correct the argument order so callers are not broken by go-redis v9.19.0+.
DerkSchooltink
force-pushed
the
fix/zrange-rev-start-stop-ordering
branch
from
May 5, 2026 08:23
9983dda to
30eac12
Compare
cschleiden
previously approved these changes
May 25, 2026
cschleiden
enabled auto-merge (rebase)
May 25, 2026 03:19
Owner
|
@DerkSchooltink could you take a look at the redis CI test failure? |
auto-merge was automatically disabled
June 3, 2026 11:24
Head branch was pushed to by a user without write access
DerkSchooltink
force-pushed
the
fix/zrange-rev-start-stop-ordering
branch
from
June 3, 2026 11:46
a1c18d7 to
830b178
Compare
go-redis v9.0.2 internally swapped Start and Stop when Rev: true in ZRangeArgsCmd.appendArgs. The code fix in this PR (swapping Start/Stop to match Redis semantics) caused a double-swap against v9.0.2, making GetWorkflowInstances return empty results. go-redis v9.19.0 (#3751) removed that silent swap, so the explicit Start >= Stop ordering in the code now maps directly to the Redis ZRANGE key max min BYSCORE REV command as intended.
DerkSchooltink
force-pushed
the
fix/zrange-rev-start-stop-ordering
branch
from
June 3, 2026 11:48
830b178 to
38bcf41
Compare
Contributor
Author
seems like I forgot to pin the correct version of Redis, should be fixed now @cschleiden |
cschleiden
approved these changes
Jun 5, 2026
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 #479.
Problem
GetWorkflowInstancesreturns 0 results with go-redis v9.19.0+. go-redis v9.19.0 (#3751) removed the silentStart/Stopswap forZRANGE BYSCORE REV. Redis requiresStart≥StopwhenRev: true; the previous code had them reversed and relied on the library correcting it.Fix
Swap
StartandStopin theZRangeArgscall (backend/redis/diagnostics.go).Tests added
Test_Diag_GetWorkflowInstances_Ordering— verifies newest-first ordering across multiple instancesTest_Diag_GetWorkflowInstances_Pagination— verifiesafterInstanceIDpagination returns non-overlapping pages