Desk: a stale answer on an oversize fork is 422 fork_too_large (#44)

This commit is contained in:
Heimdall 2026-11-11 01:54:04 +00:00
commit 05dcceb203
2 changed files with 38 additions and 3 deletions

View file

@ -229,6 +229,13 @@ public static class DeskEndpoints
if (string.Equals(result.Answer.Code, DeskStatus.StaleFork, StringComparison.Ordinal))
{
var current = await door.ReadAsync(mind.Socket, context, result.Answer.ForkId, cancellationToken);
if (current is DeskReadOutcome.ForkTooLarge(var largeFork))
{
// Nothing is recorded for a stale answer, and the card it would carry cannot be returned: permanent.
await WriteJsonAsync(http, DeskRefusals.ForkTooLargeStatus, DeskRefusals.ForkTooLargeDocument(largeFork));
return;
}
if (current is not DeskReadOutcome.Found(var entry))
{
await WriteUnavailableAsync(http, desk);