fix(guild_chat): wait_interval as raw int + capture-replay request field name
Remove StringifiedIntConverter from GuildChatMessagesResponse.WaitInterval so the
wire emits a raw JSON number (3) matching prod, not a quoted string ("3").
Update GuildChatPollTests (2 assertions) and GuildCaptureReplayTests (1 assertion +
comment) to expect JsonValueKind.Number. Fix last_message_id → start_message_id typo
in GuildChatMessages_Member_ReturnsProdShape request body.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -330,9 +330,12 @@ public class GuildChatPollTests
|
||||
Assert.That(messages.GetArrayLength(), Is.EqualTo(0),
|
||||
"chat_message must be empty for a viewer not in a guild");
|
||||
|
||||
// wait_interval is stringified; idle default is ChatPollIdleSeconds (10)
|
||||
int waitInterval = GetStringifiedInt(root, "wait_interval");
|
||||
Assert.That(waitInterval, Is.GreaterThan(0), "wait_interval must be positive");
|
||||
// wait_interval is a raw JSON number; idle default is ChatPollIdleSeconds (10)
|
||||
Assert.That(root.TryGetProperty("wait_interval", out var waitEl), Is.True,
|
||||
"Response must have 'wait_interval' field");
|
||||
Assert.That(waitEl.ValueKind, Is.EqualTo(JsonValueKind.Number),
|
||||
"'wait_interval' must be a raw JSON number (prod sends 3, not \"3\")");
|
||||
Assert.That(waitEl.GetInt32(), Is.GreaterThan(0), "wait_interval must be positive");
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
@@ -354,11 +357,11 @@ public class GuildChatPollTests
|
||||
|
||||
// Leader gets messages → active interval
|
||||
var activePoll = await PollAsync(leaderClient, startMessageId: 0, direction: 1);
|
||||
int activeWait = GetStringifiedInt(activePoll, "wait_interval");
|
||||
int activeWait = activePoll.GetProperty("wait_interval").GetInt32();
|
||||
|
||||
// Lonely viewer not in a guild → idle interval
|
||||
var idlePoll = await PollAsync(lonelyClient, startMessageId: 0, direction: 1);
|
||||
int idleWait = GetStringifiedInt(idlePoll, "wait_interval");
|
||||
int idleWait = idlePoll.GetProperty("wait_interval").GetInt32();
|
||||
|
||||
Assert.That(activeWait, Is.LessThan(idleWait),
|
||||
$"Active interval ({activeWait}s) must be less than idle interval ({idleWait}s)");
|
||||
|
||||
Reference in New Issue
Block a user