Trying to use a realtime for database channel
TypeScript
useEffect(() => {
const unsubscribe = client.subscribe(
`databases.${MAIN_DATABASE_ID}.collections.${REPORTS_COLLECTION_ID}.documents.${reportInfo.id}.update`,
(response) => {
setReportInfo({
...reportInfo,
active: (response.payload as any).vote_active,
});
},
);
console.log('unsubscribe:', unsubscribe)
return () => {
unsubscribe();
};
}, [reportInfo]);````
but for some reason, it returns 400 bad request
TL;DR
Title: Realtime 400 bad request
Developers are using a realtime database channel but encountering a 400 bad request. The issue may stem from how the client is subscribing to the database channel. Make sure the subscription details are accurate.Recommended threads
- Endless certificate generation cycle
Hello, when I try to add the subdomain stats.hedgehog-rp.ru, I get an infinite loop while the certificate is being generated. There are no problems with adding ...
- Update from 1.8 to 1.8.1 failing
I have spent the past 2 hours trying to figure this out but I really dont know what to do. 1.8. was a fresh install because the upgrade from 1.7.4 was a total m...
- Realtime not working for some tables
Hi, I've got an issue where I can setup a realtime connection to listen to some tables, but some not all. I have two tables `history` and `users`. Both can be ...