From 6c231ef1c66316d07aa42e8b0f12a508509b77c2 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Sat, 11 Apr 2026 04:53:35 +0000 Subject: [PATCH] fix: use started_at (not created_at) in RLS test session INSERT sessions table has started_at as the timestamp column, not created_at. Co-Authored-By: Claude Sonnet 4.6 --- backend/tests/test_rls_isolation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/tests/test_rls_isolation.py b/backend/tests/test_rls_isolation.py index ee8136af..0985aaa9 100644 --- a/backend/tests/test_rls_isolation.py +++ b/backend/tests/test_rls_isolation.py @@ -328,16 +328,16 @@ async def session_row_ids(admin_conn): ai_session_a_id = str(uuid.uuid4()) ai_session_b_id = str(uuid.uuid4()) - # Insert sessions rows + # Insert sessions rows (sessions uses started_at not created_at) await admin_conn.execute(f""" INSERT INTO sessions ( id, tree_id, user_id, account_id, tree_snapshot, - path_taken, decisions, custom_steps, created_at, updated_at + path_taken, decisions, custom_steps, started_at ) VALUES ('{session_a_id}', '{tree_a_id}', '{user_a_id}', '{ACCOUNT_A_ID}', - '[]'::jsonb, '[]'::jsonb, '[]'::jsonb, '[]'::jsonb, NOW(), NOW()), + '[]'::jsonb, '[]'::jsonb, '[]'::jsonb, '[]'::jsonb, NOW()), ('{session_b_id}', '{tree_b_id}', '{user_b_id}', '{ACCOUNT_B_ID}', - '[]'::jsonb, '[]'::jsonb, '[]'::jsonb, '[]'::jsonb, NOW(), NOW()) + '[]'::jsonb, '[]'::jsonb, '[]'::jsonb, '[]'::jsonb, NOW()) """) # Insert ai_sessions rows