Skip to content

Commit 163c0e2

Browse files
test(server): update passive capture missing session expectation
1 parent 6976950 commit 163c0e2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

internal/server/server_e2e_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,18 +281,18 @@ func TestPassiveCaptureEndpointInvalidJSON(t *testing.T) {
281281
}
282282
}
283283

284-
func TestPassiveCaptureEndpointReturnsServerErrorWhenSessionMissing(t *testing.T) {
284+
func TestPassiveCaptureEndpointReturnsNotFoundWhenSessionMissing(t *testing.T) {
285285
_, ts := newE2EServer(t)
286286
client := ts.Client()
287287

288-
// No session created; saving observations should fail with FK constraint.
288+
// No session created; passive capture now fails before attempting a DB insert.
289289
captureResp := postJSON(t, client, ts.URL+"/observations/passive", map[string]any{
290290
"session_id": "missing-session",
291291
"project": "engram",
292-
"content": "## Key Learnings:\n\n1. This long learning should trigger a DB insert and fail on FK",
292+
"content": "## Key Learnings:\n\n1. This long learning should trigger validation before DB insert",
293293
})
294-
if captureResp.StatusCode != http.StatusInternalServerError {
295-
t.Fatalf("expected 500 when session does not exist, got %d", captureResp.StatusCode)
294+
if captureResp.StatusCode != http.StatusNotFound {
295+
t.Fatalf("expected 404 when session does not exist, got %d", captureResp.StatusCode)
296296
}
297297
}
298298

0 commit comments

Comments
 (0)