Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<PropertyGroup Condition="'$(IsPackable)' != 'false'">
<!-- Assembly identity stays fixed permanently; release only by advancing PackageVersion. -->
<PackageVersion>1.3.0</PackageVersion>
<PackageVersion>1.3.1</PackageVersion>
<Version>$(PackageVersion)</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<InformationalVersion>$(PackageVersion)</InformationalVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Fitz.Abstractions/Domains/Kv/KvTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public sealed record KvScanResult(IReadOnlyList<KvPair> Pairs, bool HasMore);
public sealed record KvScanQuery(
ReadOnlyMemory<byte>? StartKey = null,
ReadOnlyMemory<byte>? EndKey = null,
ulong? Limit = null,
uint? Limit = null,
bool Reverse = false);

/// <summary>A committed KV mutation notification.</summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Fitz.Core/Domains/Kv/KvTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public async Task<KvScanResult> ScanAsync(KvScanQuery query, CancellationToken c
writer.WriteU8(query.Limit.HasValue ? (byte)1 : (byte)0);
if (query.Limit.HasValue)
{
writer.WriteU64(query.Limit.Value);
writer.WriteU32(query.Limit.Value);
}

// Encode reverse flag
Expand Down
6 changes: 3 additions & 3 deletions src/Fitz.Extensions/KvDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ public async ValueTask<Page<T>> QueryAsync(
var cursorKey = DecodeCursor(query.Cursor, fingerprint);
ValidateCursorRange(cursorKey, rangeStart, rangeEnd);
var scan = query.IsDescending
? new KvScanQuery(rangeStart, cursorKey ?? rangeEnd, (ulong)(limit + 1), Reverse: true)
? new KvScanQuery(rangeStart, cursorKey ?? rangeEnd, (uint)(limit + 1), Reverse: true)
: new KvScanQuery(cursorKey is null ? rangeStart : After(cursorKey.Value.Span), rangeEnd,
(ulong)(limit + 1));
(uint)(limit + 1));
await using var transaction = await client.BeginAsync(route, KvDurability.Async, KvMode.ReadOnly, ct)
.ConfigureAwait(false);
var matches = new List<KvPair>(limit + 1);
Expand Down Expand Up @@ -223,7 +223,7 @@ public async ValueTask<KvDirectoryBackfillPage> BackfillAsync(
var cursorKey = DecodeCursor(cursor, fingerprint);
ValidateCursorRange(cursorKey, rangeStart, rangeEnd);
var scan = new KvScanQuery(
cursorKey is null ? rangeStart : After(cursorKey.Value.Span), rangeEnd, (ulong)(limit + 1));
cursorKey is null ? rangeStart : After(cursorKey.Value.Span), rangeEnd, (uint)(limit + 1));
await using var transaction = await client.BeginAsync(route, KvDurability.Async, KvMode.ReadWrite, ct)
.ConfigureAwait(false);
var records = new List<KvPair>(limit + 1);
Expand Down
4 changes: 2 additions & 2 deletions test/Fitz.Extensions.Tests/KvDirectoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ await WriteAsync(client, transaction => Directory.InsertAsync(
Assert.Equal(["Alpha", "Beta"], page.Items.Select(static widget => widget.Name));
Assert.Null(page.NextCursor);
Assert.All(client.Operations.Where(static operation => operation.Operation is KvTestOperation.Scan),
static operation => Assert.Equal((ulong)3, operation.ScanQuery!.Limit));
static operation => Assert.Equal((uint)3, operation.ScanQuery!.Limit));
}

[Fact]
Expand All @@ -78,7 +78,7 @@ await Directory.InsertAsync(transaction,
Assert.NotNull(page.NextCursor);
Assert.DoesNotContain(client.Operations, static operation => operation.Operation is KvTestOperation.Get);
var scan = Assert.Single(client.Operations, static operation => operation.Operation is KvTestOperation.Scan);
Assert.Equal((ulong)4, scan.ScanQuery!.Limit);
Assert.Equal((uint)4, scan.ScanQuery!.Limit);
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion test/Fitz.Testing.Tests/InMemoryKvClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public async Task ShouldExposeClonedTransactionAndScanDetailsGivenDirectoryStyle
Assert.Equal(KvMode.ReadOnly, begin.Mode);
Assert.Equal("team\0"u8.ToArray(), scan.ScanQuery!.StartKey!.Value.ToArray());
Assert.Equal([.. "team"u8, 1], scan.ScanQuery.EndKey!.Value.ToArray());
Assert.Equal(25UL, scan.ScanQuery.Limit);
Assert.Equal(25U, scan.ScanQuery.Limit);
Assert.True(scan.ScanQuery.Reverse);
}

Expand Down
Loading