WorkersMessageQueue writes __fedify_ordering_key__ and __fedify_payload__ in enqueue() and enqueueMany(), then reads them back in processMessage(). The wrapper is a wire format with a queue in the middle, and nothing ties the two ends together.
Every processMessage() test builds its input by hand: packages/cfworkers/test/mq.test.ts lines 248, 259, 268, 284, 313, 333, 357, and 380, and packages/cfworkers/src/mod.test.ts lines 331, 346, 381, and 389. The producer tests hard-code the same shape on their own side. Change both sides at once and the suite stays green.
Add a round trip to packages/cfworkers/test/mq.test.ts. Enqueue a message, take the value that send() received, pass it to processMessage(), and check that the payload and the ordering key survive. Do the same for enqueueMany() with one item's body from the sendBatch() call, which also pins down that both producers agree on the shape.
Use the vi.spyOn(env.Q1, …) pattern already in that file rather than adding a mock queue.
Suggested check: mise run check-each cfworkers.
WorkersMessageQueuewrites__fedify_ordering_key__and__fedify_payload__inenqueue()andenqueueMany(), then reads them back inprocessMessage(). The wrapper is a wire format with a queue in the middle, and nothing ties the two ends together.Every
processMessage()test builds its input by hand: packages/cfworkers/test/mq.test.ts lines 248, 259, 268, 284, 313, 333, 357, and 380, and packages/cfworkers/src/mod.test.ts lines 331, 346, 381, and 389. The producer tests hard-code the same shape on their own side. Change both sides at once and the suite stays green.Add a round trip to packages/cfworkers/test/mq.test.ts. Enqueue a message, take the value that
send()received, pass it toprocessMessage(), and check that the payload and the ordering key survive. Do the same forenqueueMany()with one item'sbodyfrom thesendBatch()call, which also pins down that both producers agree on the shape.Use the
vi.spyOn(env.Q1, …)pattern already in that file rather than adding a mock queue.Suggested check:
mise run check-each cfworkers.