Skip to content

Commit ea3e6e9

Browse files
committed
fix(worker): omit null filterId/workerId in pool claim JSON for Zod-friendly bodies
Made-with: Cursor
1 parent a911991 commit ea3e6e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Motely.DistributedWorker/WorkerDtos.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,17 @@ internal sealed class PoolClaimRequestDto
6060
[JsonPropertyName("action")]
6161
public string Action { get; set; } = "request";
6262

63+
/// <summary>Omit when null so JSON has no <c>workerId</c> key — avoids APIs that treat explicit null as invalid.</summary>
6364
[JsonPropertyName("workerId")]
65+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6466
public string? WorkerId { get; set; }
6567

6668
/// <summary>
6769
/// Optional: target a specific filter ("GIMMIE WORK FOR FILTER:X").
68-
/// If null, server picks whatever active session needs help most ("GIMMIE WORK").
70+
/// If null, omit property — server picks any active session; explicit JSON null breaks some Zod schemas.
6971
/// </summary>
7072
[JsonPropertyName("filterId")]
73+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
7174
public string? FilterId { get; set; }
7275

7376
[JsonPropertyName("estimatedBlocks")]

0 commit comments

Comments
 (0)