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
- [SOLVED] Error upgrading from 1.8.1 to 1...
DO Self-hosted server failed to upgrade with this error "Error response from daemon: client version 1.52 is too new. Maximum supported API version is 1.42". U...
- MariaDB refuses to connect to appwrite
Earlier, I tried updating my Appwrite version from 18.1.x to the latest release because my Flutter package required it to function properly. I used the official...
- Custom API domain is unreachable
Earlier my custom api domain was working fine. Now it seems to be offline without a trace a few hours later. I didn't change anything, all the relevant DNS reco...