You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered this issue only when the edge function I'm using is deployed. I've written some code where I insert a record and a few lines of code after I update the same record. It happens sometimes that updates return this error:
This is in mainly the code compiled from multiple files:
import{Database}from'../../database.types.ts';import{supabaseConfig}from'./config.ts';import{createClient}from'@supabase/supabase-js';constsupabaseClient=createClient<Database>(supabaseConfig.SB_URL,supabaseConfig.SB_KEY);constchaptersDB=supabaseClient.from('chapter');const{data: chapter, error }=awaitchaptersDB.insert({--columnshere--}).select().single();const{ id }=chapter;const{ error }=awaitchaptersDB.update({--columnshere--}).eq('id',id);const{ error }=awaitchaptersDB.update({--othercolumnshere--}).eq('id',id);
What am I doing wrong?
It feels like those queries run in different transactions and the first one doesn't end after the insert.
Do I need to somehow destroy the supabase client after each edge function execution? This does not happen right after deploying the function, but after a couple of runs.
Bug report
Describe the bug
I encountered this issue only when the edge function I'm using is deployed. I've written some code where I insert a record and a few lines of code after I update the same record. It happens sometimes that updates return this error:
This is in mainly the code compiled from multiple files:
What am I doing wrong?
It feels like those queries run in different transactions and the first one doesn't end after the insert.
Do I need to somehow destroy the supabase client after each edge function execution? This does not happen right after deploying the function, but after a couple of runs.