I’m strangely stuck in my dev because of the UPDATE (and UPSERT, and REST API Request) Supabase action in a workflow.
I created a workflow that triggers on a text input “on change” where I use Supabase Update action to edit an object : in my table “polls” selected by the “id” (I give a hardcoded value to test), I pass the “title” (and also the owner(=user_id) but I should not, it’s a desperate action ). When ran this workflow raises an error saying :
TypeError: Cannot read properties of undefined (reading ‘id’)
at https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110942
at Proxy.every ()
at https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110921
at Array.findIndex ()
at je (https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110905)
at Object.onSubscribe (https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110134)
at Object.update (https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:108772)
at async eval (eval at executeCode (https://editor-cdn.weweb.io/public/js/index.ff56b997.js:1:343949), :1:28)
at async executeCode (https://editor-cdn.weweb.io/public/js/index.ff56b997.js:1:343943)
at async bt (https://editor-cdn.weweb.io/public/js/index.ff56b997.js:1257:37734)".
I don’t get it I don’t see any of my variables ‘undefined’ - I don’t use any variable except user_id in that request, but same problem without this parameter…
With Upsert action it’s another error saying “Error: new row violates row-level security policy (USING expression) for table “polls” at Object.upsert …” while Supabase Insert action works well (with an authentication policy with “WITH CHECK” expression), independently. I guess it’s another issue, lesser priority to me, but I wonder also.
With the REST API resquest, there it is a “Error: new row violates row-level security policy (USING expression) for table “polls” at Object.upsert …” while I’m using the apikey given in Supabase, etc…
Screenshots below : one for the Update, one for the Upsert, the other for the REST API Request…
I wonder if these 3 errors are linked.
Thanks for your help ! (and long live WeWeb!)