
Hi Support, we are still experiencing the issue and we are a subscriber on your platform under the account of charlesbcalague@gmail.com
I just want to ask here if there's any workaround with the disconnect issues we're encountering when subscribing to realtime events in react native using expo and also having this INVALID_STATE_ERR.
ERROR Realtime got disconnected. Reconnect will be attempted in 1 seconds. Stream end encountered ERROR Error: INVALID_STATE_ERR, js engine: hermes
Here's how we implemented in subscribing for realtime events based off on your documentations:
useEffect(() => { let unsubscribe = null;
const setupRealtimeListeners = async () => {
try {
unsubscribe = client.subscribe(
[
databases.${secrets.appwriteConfig.databaseId}.collections.${secrets.appwriteConfig.messagesCollectionsId}.documents,
databases.${secrets.appwriteConfig.databaseId}.collections.${secrets.appwriteConfig.chatsReadCollectionId}.documents,
],
(response) => {
if (response.payload?.$collectionId === secrets.appwriteConfig.messagesCollectionsId) {
handleRealTimeMessagesEvents(response);
} else if (response.payload?.$collectionId === secrets.appwriteConfig.chatsReadCollectionId) {
handleRealTimeMessageReadEvents(response);
}
},
);
} catch (err) {
console.error("Realtime not ready or subscription failed:", err);
}
};
setupRealtimeListeners();
return () => {
if (unsubscribe) unsubscribe();
chatIdRef.current = null;
};
}, []);
Recommended threads
- Get all Documents and Expanded Relations...
I have multiple (quite small) collections that have many-to-many relationships. How can we return all documents and expanded relationship for a specific collec...
- Functions Failing Due to Installed Depen...
Hi team! Before anything, I am on the so far while we're in the planning phase of the app, and will be upgrading to pro soon. If there's a possibility that this...
- The new Bulk API and Realtime updates
It seems that the new Bulk API doesn't actually send realtime updates which is making a huge problem for me. I also wanted to know different is it deleting mul...
