From a071f0a7dfb8daf58a44a216e7434cc445214f26 Mon Sep 17 00:00:00 2001 From: Cosmin Staicu Date: Thu, 16 Jul 2026 22:34:56 +0300 Subject: [PATCH] chore(deps): bump StackExchange.Redis from 2.10.1 to 2.13.17 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First step of the staged StackExchange.Redis upgrade toward 3.0. 2.13.17 is the latest 2.x and shares 3.0's public API, so it de-risks the major bump. No public API or runtime behavior change. The only breakage was a test fixture: SE.Redis 2.13.17 grew the internal StreamInfo constructor from 7 to 16 parameters, and RedisStreamHealthMaintainerTests fabricates StreamInfo via reflection with a hardcoded positional arg list. The old 7-arg call no longer bound, the fixture threw, and the maintainer's try/catch swallowed it — surfacing as "received no matching calls" on the downstream mocks. Production is unaffected (it gets real StreamInfo objects from SE.Redis deserialization, never this reflection). GenerateStreamInfo now fills by the ctor's actual parameter list and sets only the fields the maintainer reads, so it survives this bump and the upcoming 3.0 one. Verified: full suite green on net8.0 and net10.0 (1174/1174 each), including the live-Redis reflection guards from #82. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Cosmin Staicu --- CHANGELOG.md | 4 +++ Directory.Packages.props | 2 +- .../Broadcast/RedisStreamTopicMonitorTests.cs | 34 ++++++++++++------- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 895a173..6ff2d7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] +### Changed + +- Bumped `StackExchange.Redis` from 2.10.1 to 2.13.17 (latest 2.x), the first step of the staged upgrade toward 3.0. No public API or runtime behavior change. + ## [1.0.1] - 2026-07-15 ### Changed diff --git a/Directory.Packages.props b/Directory.Packages.props index 6f0855c..0363cbe 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -44,7 +44,7 @@ - + diff --git a/tests/UiPath.Caching.Tests/Broadcast/RedisStreamTopicMonitorTests.cs b/tests/UiPath.Caching.Tests/Broadcast/RedisStreamTopicMonitorTests.cs index 96f54ff..f787d4a 100644 --- a/tests/UiPath.Caching.Tests/Broadcast/RedisStreamTopicMonitorTests.cs +++ b/tests/UiPath.Caching.Tests/Broadcast/RedisStreamTopicMonitorTests.cs @@ -306,19 +306,27 @@ public ValueTask InitializeAsync() private StreamInfo GenerateStreamInfo(int? groupsCount = null) { - //int length, int radixTreeKeys, int radixTreeNodes, int groups, StreamEntry firstEntry, StreamEntry lastEntry, RedisValue lastGeneratedId - object?[] args = [ - (object?)_fixture.Create(), - (object?)_fixture.Create(), - (object?)_fixture.Create(), - (object?) groupsCount ?? _fixture.Create(), - (object?)_fixture.Create(), - (object?)_fixture.Create(), - (object?)(RedisValue)_lastGeneratedId - ]; - - var streamInfo = (StreamInfo)Activator.CreateInstance(typeof(StreamInfo), BindingFlags.Instance | BindingFlags.NonPublic, null, args, null)!; - return streamInfo; + // StreamInfo's internal ctor keeps its leading params (length, radixTreeKeys, radixTreeNodes, + // groups, firstEntry, lastEntry, lastGeneratedId) stable but grows a trailing tail across + // StackExchange.Redis versions. Fill by the actual ctor's parameter list and set only the + // fields the maintainer reads, so version bumps that append params don't break this fixture. + var ctor = typeof(StreamInfo).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic).Single(); + var parameters = ctor.GetParameters(); + var args = new object?[parameters.Length]; + for (var i = 0; i < parameters.Length; i++) + { + args[i] = parameters[i].ParameterType.IsValueType ? Activator.CreateInstance(parameters[i].ParameterType) : null; + } + + args[0] = _fixture.Create(); + args[1] = _fixture.Create(); + args[2] = _fixture.Create(); + args[3] = groupsCount ?? _fixture.Create(); + args[4] = _fixture.Create(); + args[5] = _fixture.Create(); + args[6] = (RedisValue)_lastGeneratedId; + + return (StreamInfo)ctor.Invoke(args); } private StreamGroupInfo GenerateGroupInfo(DateTimeOffset lastGenerated, int? consumerCount = null)