-
-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Real time not working in Local Dev #21624
Comments
Thanks for reporting this, can you confirm that realtime also does not work in the dashboard (selecting |
@encima Unfortunately the real-time menu is not available in the local-dev instance, I do have the database replication on for the I am not that experienced with docker, please do let me know if I need to share some more info on this. These are the logs I captured just after I removed a row from the table There still are no changes reflected |
Just confirmed once again, that it does work on the supabase instance.
|
Ah yes, sorry, my bad, you are right. The docker logs you included are the most useful here, they point to an issue with authentication. This could be an issue with the user you are subscribing to or the JWT secret you have set locally |
Possible, can you try subscribing to a channel using a token signed by your JWT secret? Or a user token? |
@encima I am sorry I didn't get you when you said subscribing to a channel. I do have the same numbers as in |
@Mohammed-Yasin-Mulla No need to apologise, I probably was not clear! Instead of using your user, could you try and authenticate using a custom JWT, see the example here? Then we will know if this is an issue with your SMS auth or with Realtime! |
I tried that but still no luck, Error Message : Android Bundling failed 3579ms
The package at "node_modules/jsonwebtoken/verify.js" attempted to import the Node standard library module "crypto".
It failed because the native React runtime does not include the Node standard library.
Learn more So I used react-native-pure-jwt My code snippet import { sign } from 'react-native-pure-jwt';
const supabaseJWT = 'super-secret-jwt-token-with-at-least-32-characters-long';
async function getSupabaseJWT(userid: string) {
sign(
{
userid,
role: 'authenticated',
exp: Math.floor(Date.now() / 1000) 60 * 60,
}, // body
supabaseJWT, // secret
{alg: 'HS256'})
.then((val: string) => setCustomJWT(val)) // token as the only argument
.catch(console.error); // possible errors
}
// JWT Token gen -> eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYXV0aGVudGljYXRlZCIsImV4cCI6MTcwOTMxOSwidXNlcmlkIjoiNjg1ODhiNGQtMzdlZS00NmQzLWIyYjAtMjRkMmMyMGZkZmY3In0.LhT3NJniY-Las1_mAX1yuO4HmCF4eJB6MA-skbyGgD4 Implementation of real-time // Note: this is React native project
const supabase = createClient<Database>(supabaseUrl, supabaseAnonKey, {
auth: {
storage: AsyncStorage,
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false,
},
global: {
headers: {
Authorization: `Bearer ${customJWT}`,
},
},
});
useEffect(() => {
supabase.realtime.setAuth(customJWT);
const channel = supabase
.channel('db-changes')
.on(
'postgres_changes',
{
event: '*',
schema: 'public',
table: 'user_orders',
},
payload => console.log(payload)).subscribe(msg => console.log(`Subscribed ${msg}`));
return () => {
supabase.removeChannel(channel);
};
} Error Log LOG Subscribed CHANNEL_ERROR |
Check your logs in the Log Explorer in the dashboard, there is likely an issue with the token you are generating and any errors will tell you if there is an issue with the token or if it is missing information (in this case, it is probably because you are not setting the |
@encima could you please check if you can use the real-time feature using the local instance It would confirm that then It is an issue specific to mine. |
@Mohammed-Yasin-Mulla the realtime inspector is now available in the latest docker image. Can you try upgrading and see if you can see any realtime events? |
I had the same issues that you did. |
Hey, @tb1995 thank you for the response, I am developing it on react native (mobile devices), The URL If your server is running on your development machine and you want to access it from your mobile app, you need to replace In my case, the IP address is |
Hi @Mohammed-Yasin-Mulla - Just checking in here, Is this working for you now? |
@Hallidayo I was unable to resolve this issue |
Having the same issue, creating a basic table and then adding/removing rows on a local setup does not trigger the Supabase Dart SDK's listen method. The following code only runs once on app start, but adding or removing rows in the local db http://127.0.0.1:54323/project/default/database does nothing. I enabled realtime sync on the local studio url.
|
Bug report
Describe the bug
Real-Time is NOT working on local-dev env but works fine on the supabase instance
using the same code
also tried re-installing local docker image as well
Enabled in the
config.toml
filealso have real-time enabled in local dev using the studio
Code snippet :
To Reproduce
Expected behaviour
Real-time functionality should work as it works on the supabase instance
System information
The text was updated successfully, but these errors were encountered: