You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i use realtime to listen to database i get this error:
WebSocket connection to 'wss://cloud.appwrite.io/v1/realtime?project=<project>&channels%5B%5D=databases.6623e3aa881153ccd832.collections.orders.documents.662b7dbd6748895df4a6' failed:
Realtime got disconnected. Reconnect will be attempted in 1 seconds.
The same code was working till two days ago.
I'm connected to AppWrite Cloud with starter free plan.
The project is a simple vite + react project, the interesting parti is this:
FILE Test.tsx
import { useEffect } from 'react';
import { subscribeToOrder } from '../backend';
export const TestCmp = () => {
useEffect(() => {
const unsubOrder = subscribeToOrder('662b7dbd6748895df4a6', (order) => {
console.log('order changed: ', order);
});
return () => {
console.log('Unmounted Home');
if (unsubOrder) {
console.log('unsub');
unsubOrder();
}
};
}, []);
return (
<div>
<h1>Test</h1>
</div>
);
};
FILE backend.ts
import { Client, Storage, Account, Databases, Models, ID, Permission, Role, Query } from 'appwrite';
export const client = new Client();
client.setEndpoint('https://cloud.appwrite.io/v1').setProject('<projectID>'); // Replace with your project ID
export const account = new Account(client);
export const db = new Databases(client);
export const storage = new Storage(client);
const databaseID = '<dbID>';
const bucketID = '<bucketID>';
const excelFileID = 'template-excel';
export { ID } from 'appwrite';
type OrderDocument = Order & Models.Document;
type OperatorDocument = Operator & Models.Document;
type TestDocument = Test & Models.Document;
export const subscribeToOrder = (orderId: string, callback: (order: Order) => void) => {
return client.subscribe<OrderDocument>(
`databases.${databaseID}.collections.orders.documents.${orderId}`,
(response) => {
// Callback will be executed on changes for documents A and all files.
console.log('collections.orders.documents', response);
callback({ ...response.payload, id: response.payload.$id });
}
);
};
馃憤 Expected behavior
Connect and listen to realtime events from the server.
馃憥 Actual Behavior
WebSocket connection to 'wss://cloud.appwrite.io/v1/realtime?project=<project>&channels%5B%5D=databases.6623e3aa881153ccd832.collections.orders.documents.662b7dbd6748895df4a6' failed:
Realtime got disconnected. Reconnect will be attempted in 1 seconds.
馃幉 Appwrite version
Appwrite Cloud
馃捇 Operating system
Linux
馃П Your Environment
"appwrite": "^13.0.2",
"react": "^18.2.0",
馃憖 Have you spent some time to check if this issue has been raised before?
I checked and didn't find similar issue
One issue that i found is this #1640 but it talks about a self hosted instance of AppWrite, so this is not my use case
@dj-fiorex, thanks for raising this issue! 馃檹馃徏 I have seen some instability with realtime lately. I don't think it's a Cloud-only problem, but I think it's more apparent on Cloud due to the load. I think it's due to the concurrent connections causing conflicts/problems and improving that is going to take significant changes 馃槙
馃憻 Reproduction steps
When i use realtime to listen to database i get this error:
The same code was working till two days ago.
I'm connected to AppWrite Cloud with starter free plan.
The project is a simple vite + react project, the interesting parti is this:
馃憤 Expected behavior
Connect and listen to realtime events from the server.
馃憥 Actual Behavior
馃幉 Appwrite version
Appwrite Cloud
馃捇 Operating system
Linux
馃П Your Environment
"appwrite": "^13.0.2",
"react": "^18.2.0",
馃憖 Have you spent some time to check if this issue has been raised before?
One issue that i found is this #1640 but it talks about a self hosted instance of AppWrite, so this is not my use case
馃彚 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: