From 503c57efd907b62c27592ee70627ba61972e7b89 Mon Sep 17 00:00:00 2001 From: clawbot <35+clawbot@noreply.example.org> Date: Fri, 2 Oct 2026 18:03:20 +0200 Subject: [PATCH] Assert the body a retry delivers, not only its status (closes #294) TestProcessRetryTask_LargeBody_FetchFromDB and TestProcessRetryTask_SuccessfulRetry checked only that the delivery ended delivered, so deleting the event-body fetch on the retry path, the behaviour the first is named for, left both green while a retry could deliver an empty or truncated body. Both now compare the body the target received with the stored event body byte for byte, and both fail when that fetch is deleted. The other retry-path tests are not about the body and are unchanged. Test change only. Model: opus-5-5 --- internal/delivery/engine_integration_test.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/delivery/engine_integration_test.go b/internal/delivery/engine_integration_test.go index 90d028e..784cf2a 100644 --- a/internal/delivery/engine_integration_test.go +++ b/internal/delivery/engine_integration_test.go @@ -355,9 +355,14 @@ func TestProcessRetryTask_SuccessfulRetry(t *testing.T) { s := newISetup(t) + var receivedBody string + ts := httptest.NewServer( http.HandlerFunc( - func(w http.ResponseWriter, _ *http.Request) { + func(w http.ResponseWriter, r *http.Request) { + body, _ := io.ReadAll(r.Body) + receivedBody = string(body) + w.WriteHeader(http.StatusOK) }, ), @@ -397,6 +402,8 @@ func TestProcessRetryTask_SuccessfulRetry(t *testing.T) { context.TODO(), &task, ) + assert.Equal(t, event.Body, receivedBody) + iAssertStatus(t, s.WebhookDB, d.ID, database.DeliveryStatusDelivered, ) @@ -443,9 +450,14 @@ func TestProcessRetryTask_LargeBody_FetchFromDB( s := newISetup(t) + var receivedBody string + ts := httptest.NewServer( http.HandlerFunc( - func(w http.ResponseWriter, _ *http.Request) { + func(w http.ResponseWriter, r *http.Request) { + body, _ := io.ReadAll(r.Body) + receivedBody = string(body) + w.WriteHeader(http.StatusOK) }, ), @@ -482,6 +494,8 @@ func TestProcessRetryTask_LargeBody_FetchFromDB( context.TODO(), &task, ) + assert.Equal(t, largeBody, receivedBody) + iAssertStatus(t, s.WebhookDB, d.ID, database.DeliveryStatusDelivered, )