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)