At the top column of the HomePage I'm trying to fetch 'user_data' table from Supabase - specifically the current Authenticated user.
Problem 1: It works, but if you switch off Single Time Query then Anonymous users will get an empty page (the NULL problem)
Problem 2: If you switch on the Single Time Query, then you don't get the benefits of Supabase's Realtime, and in my case it's a functional necessity.
What am I trying to achieve? While a given user is watching an ad, I'm setting a boolean column called "disableAllAds" in his public.user_data table to TRUE (which allows me to disables buttons for all other ads). And once the bottom-sheet containing an ad has closed, I'm setting the boolean to FALSE. This is to prevent fraud and abuse - with an android emulator like LMplayer users can create multiple phones and open multiple tabs in each phone emulator, and set a bot that clicks the ads -- resulting in thousands of watched ads in just few minutes. Using AppState does not solve this problem (because AppState doesn't persist across tabs and phones), so I'm recording into user_data in Supabase, and it works like a charm when the Single Time Query is turned off, but that creates a NULL problem for the anonymous users.
So how do I solve this conundrum that has been driving me up the wall for the past 2 days??? If Auth.user and public.user_data are separate tables, how are we supposed to call the user_data of the current user and keep an eye on its changes???