diff --git a/supabase/tests/010_files_foundation.sql b/supabase/tests/010_files_foundation.sql index b4706704..5bb3cf15 100644 --- a/supabase/tests/010_files_foundation.sql +++ b/supabase/tests/010_files_foundation.sql @@ -535,8 +535,10 @@ select set_config('request.jwt.claims', '{"sub":"40000000-0000-0000-0000-0000000 select throws_ok($$ select public.confirm_asset_upload(gen_random_uuid()) $$, '42501', null, 'a deactivated account cannot confirm an upload'); select throws_ok($$ select public.begin_avatar_upload('image/jpeg', 1000) $$, '42501', null, 'a deactivated account cannot begin an upload'); reset role; -update public.assets set status = 'pending_upload', locked_at = null, lock_token = null, attempts = 0 where id = pg_temp.id('c1'); -delete from storage.objects where name = (pg_temp.row('c1')).quarantine_key; +-- Back to pending under a fresh quarantine key (the real stack forbids deleting storage rows directly). +update public.assets set status = 'pending_upload', locked_at = null, lock_token = null, attempts = 0, + quarantine_key = 'quarantine/40000000-0000-0000-0000-00000000000c/' || gen_random_uuid() || '/upload' + where id = pg_temp.id('c1'); set local role authenticated; select set_config('request.jwt.claims', '{"sub":"40000000-0000-0000-0000-00000000000c","role":"authenticated"}', true); select throws_ok(