Ho3einvb
02/16/2023, 8:21 AMRitesh
02/16/2023, 11:54 AMNeil Savin
02/16/2023, 1:22 PMrem
02/16/2023, 2:44 PMdrewbie
02/16/2023, 3:06 PMLar
02/16/2023, 3:28 PMaRosales
02/16/2023, 3:51 PMHugos
02/16/2023, 4:45 PMramr
02/16/2023, 4:52 PMnateland
02/16/2023, 5:12 PMInASunshineState
02/16/2023, 5:14 PMaar2dee2
02/16/2023, 5:15 PMadd_new_query
that reads from the profile
table and inserts into 2 tables search_query
and search_response
. This worked fine until I created a materialized view that reads from search_query
, search_response
and 1 other table.
The materialized view is refreshed using a trigger function refresh_search_feed
that is called every time there is an INSERT
, UPDATE
or DELETE
on any of the three tables that used to create the view.
When I call the postgres function add_new_query
via rpc
, I get the error:
sql
Error occurred in function add_new_query: must be owner of materialized view search_feed
I tried to change the owner of the materialized view with ALTER materialized view search_feed OWNER to authenticated;
but this throws the following error:
sql
permission denied for schema public
I guess this is happening because the materialized view is created as a table? Is there a workaround?Unknown Member
02/16/2023, 5:30 PMjoshuabaker
02/16/2023, 5:43 PMbilals
02/16/2023, 5:45 PMKen
02/16/2023, 6:05 PMLar
02/16/2023, 6:45 PMLarry@ASUS MINGW64 /c/__repos/_sv/supabase/sveltekit-supabase-dashboard (main)
$ npm install supabase --save-dev
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: sveltekit-supabase-dashboard@0.1.0
npm ERR! Found: @sveltejs/adapter-auto@1.0.0-next.80
npm ERR! node_modules/@sveltejs/adapter-auto
npm ERR! dev @sveltejs/adapter-auto@"^1.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @sveltejs/adapter-auto@"^1.0.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @sveltejs/kit@1.7.0
npm ERR! node_modules/@sveltejs/kit
npm ERR! peer @sveltejs/kit@"^1.0.0" from @sveltejs/adapter-auto@1.0.3
npm ERR! node_modules/@sveltejs/adapter-auto
npm ERR! dev @sveltejs/adapter-auto@"^1.0.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\Larry\AppData\Local\npm-cache\_logs\2023-02-16T18_39_53_904Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Larry\AppData\Local\npm-cache\_logs\2023-02-16T18_39_53_904Z-debug-0.log
mansedan
02/16/2023, 6:48 PMmiddleware.js
file to handle some protected routes. We are essentially using the strategy from the Supabase docs here: https://supabase.com/docs/guides/auth/auth-helpers/nextjs#auth-with-nextjs-middleware
The issue we are running into is that when running page speed tests the chunk for this file is being listed as 'Reduce unused JS' because of the size of the file. Is there a way to reduce this file size that we are overlooking?
Here is our final middleware.js file for reference:
js
import { NextResponse } from 'next/server'
import { createMiddlewareSupabaseClient } from '@supabase/auth-helpers-nextjs'
// This function can be marked `async` if using `await` inside
export async function middleware(request) {
const res = NextResponse.next()
// Create authenticated Supabase Client.
const supabase = createMiddlewareSupabaseClient({ req: request, res })
// Check if we have a session
const {
data: { session },
} = await supabase.auth.getSession()
// Auth condition not met, redirect to login page.
if(!session) {
const redirectUrl = request.nextUrl.clone()
redirectUrl.pathname = '/login'
redirectUrl.searchParams.set(`redirectedFrom`, request.nextUrl.pathname)
return NextResponse.redirect(redirectUrl)
}
return res;
}
// See "Matching Paths" below to learn more
export const config = {
matcher: [
/*
* Match all request paths except for the ones starting with:
* - api (API routes)
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico (favicon file)
*/
'/((?!api|_next/static|_next/image|favicon.ico|login|profile|signup).*)',
],
}
Notorious T.I.M.
02/16/2023, 6:56 PMpublicUrl
, but it's not an image.
The `publicUrl `just renders a small white square (the browser doesn't register an image there), the downloadable file from Studio isn't recognised as an image file in my OS, and there is no preview image in Studio.
How can I get from base64 data to a file in storage that is functional - i.e. I can see the image at it's publicUrl
?
This is my upload function - payload
is just the arrayBuffer
data
const { data, error } = await supabase.storage
.from(bucket)
.upload(`${path}${filename}`, payload, {
contentType: "image/png",
upsert: true
});
pers0n
02/16/2023, 8:07 PMnpm install turbo
) and get a big list of errors (too big to post in this message. I can send in txt file if you need), but from what I can tell its complaining about the installation of libpg-query
so I run npm cache clean --force
and then re run npm install
, but it still gives me the same errors.
ok. So I disregard the turbo install errors and try to just run npm run dev:docs
and I get another big error and it fails. The error pretty much says that a required package @next/mdx
could not be found. so I check my package.json for it and its in there "@next/mdx": "^12.0.4"
.
I dont know if Im following the wrong guide or missing a crucial step, but when I try to install the dependencies I am just bombarded with errors. Also I tried on a different machine and am getting the same results so this isn't an underlying issue with the packages on my specific machine. Any advice helps, thanks!Headless
02/16/2023, 8:21 PMWeedleChamp
02/16/2023, 9:09 PMbenjamin_dobell
02/16/2023, 10:51 PMaunum
02/16/2023, 10:56 PMsupabase.auth.signUp
or supabase.auth.signInWithOtp
the return values are empty:
const { data, error } = await supabase.auth.signInWithOtp({
email,
options: {
emailRedirectTo: getPropertyRedirectURL(redirectTo),
createUser: true
}
})
console.log("data", data)
// data { user: null, session: null }
The user gets created in the database, but no return value.Smiley
02/17/2023, 12:00 AMDanMossa
02/17/2023, 12:19 AMin
filter.
My code seems to work when I use the eq.
filter and changing the channel name doesn't seem to change anything.
Also, my messages
and chat_rooms
table both have RLS with the correct settings for what I want.
This is my existing code:
dart
void subscribeToChat(String accountUserId, Iterable<int> chatRoomIds) {
print("Subscribed to rooms and messages");
_supabase.channel('public:messages:$accountUserId').on(
RealtimeListenTypes.postgresChanges,
ChannelFilter(
event: 'INSERT',
schema: 'public',
table: constants.Table.messages.name,
filter: 'chat_room_id=in.(${chatRoomIds.join(',')})',
),
(payload, [ref]) {
print('New message received: ${payload.toString()}');
},
).on(
RealtimeListenTypes.postgresChanges,
ChannelFilter(
event: 'INSERT',
schema: 'public',
table: constants.Table.chat_rooms.name,
filter: 'user_id=eq.$accountUserId',
),
(payload, [ref]) {
print('New room received: ${payload.toString()}');
},
).subscribe();
}
DYELbrah
02/17/2023, 12:37 AMohadpr
02/17/2023, 12:56 AMhandle_new_user
function which tries to write to a table that no longer exists...nitehawk
02/17/2023, 1:19 AM2023-02-16T23:58:15.014 app[16e79027] waw [info] "message": "FetchError: request to <my supabase url> failed, reason: write EPROTO 139692654376896:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1546:SSL alert number 40\n",
Any idea what causes this? this is a regular GET that succeeds many times a day usually.Unknown Member
02/17/2023, 1:37 AM