
I have some trouble with realtime connections, it seems to be working on firefox, but doesnt seem to be working on chrome for some reason.
TypeScript
WebSocket connection to "" failed:
Realtime got disconnected. Reconnect will be attempted in 5 seconds.
My code:
TypeScript
// ChatWithUser.tsx
useEffect(() => {
fetchNonCurrentUser();
fetchMessages();
const unsubscribe = client.subscribe(
`databases.${appwriteConfig.databaseId}.collections.${appwriteConfig.messagesCollectionId}.documents`,
(response) => {
// Callback will be executed on all account events.
console.log("REALTIME", response);
}
);
console.log("UNSUBSCRIBE", unsubscribe);
return () => {
unsubscribe();
};
}, []);
TypeScript
// in appwrite.ts
export const client = new Client()
.setEndpoint(appwriteConfig.endpoint)
.setProject(appwriteConfig.projectId)
.setPlatform(appwriteConfig.platform);
Im using expo/react native, with cloud appwrite for everything backend. Nothing else relevant i can think of
TL;DR
Developers have trouble with realtime connections working on Chrome but not on Firefox. They are using Expo/React Native with Cloud Appwrite for backend. The issue seems to be with WebSocket connection in the code. The developers are subscribing to a collection of documents and logging the realtime response. There is no mention of a specific solution provided in the thread. Recommended threads
- CORS error
Hey everyone, I've been stumped on a CORS error trying to use the PATCH method on appwrite. I'm hosting locally. I keep getting the same two errors: 'https://c...
- TypeError: Failed to construct 'URL': In...
getting this error while everything seems fine please help me solve it this is how my config file looks: export const appwriteConfig = { projectId :impor...
- Is there an issue with cloud?
I'm trying to navigate around cloud and when pressing the buttons its not directing me to the correct page. For example, I'm here on the functions page. When I...
