Realtime Disconnects and Error: INVALID_STATE_ERR
- 1
- 2
- Databases
- Android
- Apple
- React Native
- Realtime
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;
};
}, []);
hi same issue here, did u manage to solve it?
Unfortunately still no 🙁
<@706830938205847563> did you solve this if yes how ?
Recommended threads
- Issue related to index
Why it is showing this error?
- Project paused despite active use — rest...
Hey team! My Appwrite Cloud project (685579e5000d78e67009) has been marked as paused due to inactivity, but it's actively used in production. I clicked the Rest...
- Creation failedUnknown sort order:asc. M...
Hi there, I'm getting this error on self hosted when trying to create an Index. Any ideas?