Give the counter sample integer MessagePack keys

CounterState in samples/eve-browser-network used string [Key]s, which the
registry rejects at registration, so the provider threw on open. Keys are now
0 counterId, 1 count, 2 receipts. The payload becomes a MessagePack array, so
the browser lowerer reads count positionally instead of by field name. The
getting-started chapter carried the same string-key shape and is corrected to
match.

BenchItem needed nothing: a5d1be6 already marked it [MessagePackObject]; the
earlier scan rejection came from a stale benchmark build. After rebuilding,
both types register.

No .cc stores exist under samples.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-14 00:27:19 +02:00
commit 0408768d35
3 changed files with 12 additions and 8 deletions

View file

@ -467,9 +467,9 @@ sealed class Args
[MessagePackObject]
public sealed class CounterState
{
[Key("counterId")] public string CounterId { get; set; } = "";
[Key("count")] public int Count { get; set; }
[Key("receipts")] public Dictionary<string, IncrementReceipt> Receipts { get; set; } = new(StringComparer.Ordinal);
[Key(0)] public string CounterId { get; set; } = "";
[Key(1)] public int Count { get; set; }
[Key(2)] public Dictionary<string, IncrementReceipt> Receipts { get; set; } = new(StringComparer.Ordinal);
public static CounterState Initial(string counterId) => new() { CounterId = counterId };
}