Hello everyone,
When I use client.subscribe within my React.js + vite webapp with the following lines of code: Code sniped:
[AppwriteConfig.tsx]
import { Client, Account, Databases } from "appwrite";
export const client = new Client()
  .setEndpoint("https://MYENDPOINT/v1")
  .setProject("MYPROJECTID");
export const dbID = "MYDBID";
export const collectionID = "MYCOLLECTIONID"
[App.tsx]
import {
  client,
  dbID,
  collectionID,
} from "./AppwriteConfig";
useEffect(() => {
const unsubscribe = client.subscribe(
      `databases.${dbID}.collections.${collectionID}.documents`,
      (response: any) => {
        if (
          response.events.includes(
            "databases.*.collections.*.documents.*.update"
          )
        ) {
          // Log when a new file is uploaded
          console.log(response.payload.item);
        }
      }
    );
return () => {
  unsubscribe();
};
}, []);
It should subscribe to the event for updates and don't show any errors.
Unfortunately, It acutely constantly sends an error inside the browser, but the subscription works anyways.
code: 1003, message: 'Message type is not valid.'
The Realtime Container logs don't show any errors.
Server started successfully
Connection open (user: 1)
I tested this behavior on my cloud server with side to side VPN to my home network, as well as on a completely new and clean vm on my local machine without any customization of the appwrite container stack.
Many thanks and best regards.
Recommended threads
- dart appwrite 16.2.0 throws errors
Hi there, I just updated to 1.7.4 and also wanted to update the dart appwrite sdk to fit the appwrite version I am using now. So I updated to 16.2.0 and get th...
 - Server error on multiple requests
Hi there, I've updated from 1.5.7 to 1.7.4. I am using meilisearch for indexing and have therefore a dart script which syncs the appwrite data to meilisearch in...
 - server error github after upgrade to 1.8...
I got the error Error 500 Server Error general_unknown can not connect to github