thank you for the response but my question is how to prevent user calling the nuxt api if there are banned
Yes, that’s basically what I’m doing right now — using the realtime table feature with RLS. The problem I’ve run into is that it doesn’t handle disconnects very well. When a tab is closed or the table isn’t active, the presence state doesn’t clear properly. Different browsers also freeze tabs in different ways, which causes inconsistent behavior. That’s why I was hoping Presence could give me a more reliable way to track friend activity
here is my friend relationship table ``` create table public.friends ( id uuid not null default extensions.uuid_generate_v4 (), user_id uuid not null, friend_id uuid not null, status text not null, requester_id uuid not null, created_at timestamp without time zone not null default now(), updated_at timestamp without time zone not null default now(), constraint friends_pkey primary key (id), constraint friends_unique_pair unique (user_id, friend_id), constraint friends_requester_id_fkey foreign KEY (requester_id) references auth.users (id) on delete CASCADE, constraint friends_friend_id_fkey foreign KEY (friend_id) references auth.users (id) on delete CASCADE, constraint friends_user_id_fkey foreign KEY (user_id) references auth.users (id) on delete CASCADE, constraint friends_user_order_check check ((user_id < friend_id)), constraint status_check check ( ( status = any ( array[ 'accepted'::text, 'pending'::text, 'blocked'::text, 'rejected'::text ] ) ) ) ) TABLESPACE pg_default; create index IF not exists idx_friends_lookup on public.friends using btree (user_id, friend_id, status) TABLESPACE pg_default; ```