Back

Realtime 400 bad request

  • 0
  • Self Hosted
  • Web
PingGhost
9 Aug, 2024, 15:48

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.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more