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
Hi.
I am having an issue with the FileList function failing to find any files, while used against an endpoint checking header contents.
To Reproduce
In Supabase
I have this function added to my schema, which checks data we put into it, against the tables. You can create it like this.
CREATE OR REPLACEFUNCTIONpublic.is_allowed_apikey(apikey text, tier text)
RETURNS boolean
LANGUAGE plpgsql
SECURITY DEFINER
AS $function$
Begin
RETURN (SELECT EXISTS (SELECT1FROM apikeys
WHERE key=apikey
AND tiers=tier));
End;
$function$
Then, on my bucket (which doesn't matter if is public or private), I have this RLS:
What's important about this, is. It checks if the key is in database & if the "tier" column has "TIER_NAME" in it.
In application
Now. In my C#, supabase lib using code, I have this:
publicvoidInitializeSupabase(stringprivateKey){this.privateKey=privateKey;varoptions=newSupabase.SupabaseOptions{//AutoConnectRealtime = true,Headers=newDictionary<string,string>(){{"apikey",privateKey}// Important part. Set apikey in header, to get Premium content}};Supabase.Client_supabase=newSupabase.Client(publicURL,publicKey,options);try{Task.Run(()=>_supabase.InitializeAsync()).Wait();//if (supabase.Realtime.Socket.IsConnected) supabase.Realtime.Disconnect();supabase=_supabase;status=Status.authorized;}catch{// Throw a box for the user, stating that their code was wrong}}publicvoidgetData(){foreach(Supabase.Storage.Bucket_bucketinTask.Run(()=>supabase.Storage.ListBuckets()).GetAwaiter().GetResult()){foreach(Supabase.Storage.FileObject_fileinTask.Run(()=>supabase.Storage.From(_bucket.Id).List()).GetAwaiter().GetResult()){_file.BucketId=_bucket.Id;// This is really stupid. Why isn't the bucketId filled on fetch?recursiveSupabaseFileListing(public_files,_file,"");}}}
This stuff finds all the buckets correctly. But then the bucket with verification is empty?
The Storage object inside supabase, seems to have the "Headers: apikey = rstanasto" added to it correctly, but still, doesn't report any files in the directory.
It is not a problem with the recursiveListing function, because the supabase.Storage.From(_bucket.Id).List() function returns empty array in the first place.
Expected behavior
Here is C# code that queries the endpoint correctly and gets the data
OS: Windows 10 LTSC, Build 19041.vb_release.191206-1406
Browser: Edge [Lord]
Version of supabase-csharp: 1.1.1
Version of supabase-csharp-storage: 2.0.2
Version of Visual Studio: 2022 17.12.0 Preview 1.0
Version of .NET Framework: 9.0.100-preview.7.24407.12
Additional context
It has been two days of this stuff not working and I am too tired to debug this anymore...
P.S.
I encapsulate all my supabase calls in Task.Run(() => supabase.DOSOMETHING()).GetAwaiter().GetResult(), because WinForm UI gets broken when ran inside an asynchronous context (async main).
So... I either have async context & clean supabase calls, or I have working UI. The choice is simple.
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug
Hi.
I am having an issue with the FileList function failing to find any files, while used against an endpoint checking header contents.
To Reproduce
In Supabase
I have this function added to my schema, which checks data we put into it, against the tables. You can create it like this.
Then, on my bucket (which doesn't matter if is public or private), I have this RLS:
What's important about this, is. It checks if the key is in database & if the "tier" column has "TIER_NAME" in it.
In application
Now. In my C#, supabase lib using code, I have this:
This stuff finds all the buckets correctly. But then the bucket with verification is empty?
The
Storage
object insidesupabase
, seems to have the "Headers: apikey = rstanasto" added to it correctly, but still, doesn't report any files in the directory.It is not a problem with the recursiveListing function, because the
supabase.Storage.From(_bucket.Id).List()
function returns empty array in the first place.Expected behavior
Here is C# code that queries the endpoint correctly and gets the data
this gets a response containing files, e.g.
Screenshots
NULL
System information
Additional context
It has been two days of this stuff not working and I am too tired to debug this anymore...
P.S.
I encapsulate all my supabase calls in
Task.Run(() => supabase.DOSOMETHING()).GetAwaiter().GetResult()
, because WinForm UI gets broken when ran inside an asynchronous context (async main).So... I either have async context & clean supabase calls, or I have working UI. The choice is simple.
The text was updated successfully, but these errors were encountered: