https://supabase.com/ logo
Join Discord
Powered by
# help
  • u

    ! Class self.PythonAddict = True

    07/29/2021, 5:51 AM
    hi
  • m

    magicquin

    07/29/2021, 5:51 AM
    Hey
  • m

    magicquin

    07/29/2021, 5:52 AM
    Also loving Supabase,
  • u

    ! Class self.PythonAddict = True

    07/29/2021, 5:52 AM
    Hop into #839993398554656831
  • m

    magicquin

    07/29/2021, 5:53 AM
    Awesome, will do
  • l

    lawrencecchen

    07/29/2021, 7:05 AM
    Is it possible to get supabase storage to persist images in browser cache?
    e
    m
    • 3
    • 28
  • l

    lawrencecchen

    07/29/2021, 7:06 AM
    even though there is a cache-control header, status code for public resources (eg.

    https://kplieuifhjheqbpbrdje.supabase.in/storage/v1/object/public/test-public/cat.jpg▾

    ) is never 304
  • l

    lawrencecchen

    07/29/2021, 7:15 AM
    would it also be possible to persist signed URLs in browser cache as well? afaik, createSignedURL signs a token that is returned as a query parameter. maybe storage-api could cache signed urls by their etags, so signed urls don't change on every request. also, i don't think it makes much sense for createSignedURL to be a POST request since it doesn't change server state, and caching post requests isn't common.
  • e

    everconfusedguy

    07/29/2021, 7:52 AM
    storage caching bug
  • l

    Lio

    07/29/2021, 7:56 AM
    the only reason it might be POST is because sending a body with GET isn't part of the spec/supported
  • l

    Lio

    07/29/2021, 7:57 AM
    express-js usually lets you accept
    body
    in GETs but like I said, it's generally not supported by stuff
  • y

    YelloJello

    07/29/2021, 8:16 AM
    would like some help over here if anyone here has played around with supabase real time ->
  • j

    JW

    07/29/2021, 8:26 AM
    I want to filter like this on a realtime subscription, is it possible and if yes, what's the correct syntax?:
    column_a=eq.$userId OR column_b=eq.$userId
  • j

    jason-lynx

    07/29/2021, 8:33 AM
    hello, is there a way to identify if a user is logging in via magic link?
  • y

    YelloJello

    07/29/2021, 8:36 AM
    check the user object, i remember seeing a metadata property with a provider key
  • j

    jason-lynx

    07/29/2021, 8:38 AM
    yes there's a metadata property, but it specifies
    provider: email
    , which would be the same as someone that logs in via the usual email + password method
  • y

    YelloJello

    07/29/2021, 8:42 AM
    then your best bet is to probably update/insert a record on your auth table with a bool indicating it's a magic link user after the user gets redirected by clicking on the link. the key shouldn't be the same imo, so worth putting up an issue
  • j

    jason-lynx

    07/29/2021, 8:50 AM
    alright, thank you!
  • l

    lnraahCC

    07/29/2021, 9:01 AM
    Hi guys, anyone meets an error called “an invalid response was received from the upstream server“ while calling the signup function???
  • y

    YelloJello

    07/29/2021, 9:08 AM
    are you checking if column_a or column_b exists or are you checking if they have the userId? supabase doesn't do anything smart/fancy with with the table name you throw into
    from()
    so you would just follow the syntax of postgrest, so you wouldn't use OR as in the SQL operator, you'd use
    or
    but I don't quite get what you're trying to do
  • j

    JW

    07/29/2021, 9:09 AM
    I am trying to filter if the userId exists in column_a or column_b, sorry for confusion
  • y

    YelloJello

    07/29/2021, 9:10 AM
    and why would you do this with a realtime sub?
  • y

    YelloJello

    07/29/2021, 9:11 AM
    to put it in a better way, is it possible for you to run that filter query before you create the sub?
  • j

    JW

    07/29/2021, 9:25 AM
    It's necessary to filter both with a realtime subscription
  • y

    YelloJello

    07/29/2021, 9:56 AM
    my bad, i went down the rabbit hole and found out that while apparently
    SupbaseQueryBuilder
    extends
    PostgrestQueryBuilder
    , the table prop from
    from()
    is handed off to
    SupabaseRealtimeClient
    when calling
    on()
    . So the postgrest syntax is not valid
  • y

    YelloJello

    07/29/2021, 9:57 AM
    i couldn't find any syntax validation on the realtime-js lib so i guess the validation is done on the server-side and as far as i can see, you can't do most common db operations before making the subscription. afaik the only stuff that works rn is listening to changes on a table, or on certain rows
  • j

    JW

    07/29/2021, 9:59 AM
    Thanks for your help, then I might use two subscriptions for now until something changes, even though i don't like this approach
  • y

    YelloJello

    07/29/2021, 10:00 AM
    you could instead listen to the table changes in general, and perform the filter query once the change has been streamed too tho
  • y

    YogurtDrinker

    07/29/2021, 10:35 AM
    Can someone suggest a way. I'm using vanilla JS so i've imported the CDN JS file. In the bottom there is
    Copy code
    <script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js"></script>
            <script src="index.js"></script>
  • y

    YogurtDrinker

    07/29/2021, 10:36 AM
    So in my index.js i do something to test whether it's working
    Copy code
    const { createClient } = supabase;
    
    const supabase = createClient('MyLink', 'MyKey');
    
    document.addEventListener("load", async() => {
        const {data, error} = await supabase.from("Course").select();
        console.log(data);
    });
1...222324...316Latest