Rank 1: Thread
and I'm waiting to see the update (and the console log)
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 1: Thread
and I'm waiting to see the update (and the console log)
Moderator
Hmmm unsubscribe is actually subscribing 🤔
Rank 1: Thread
well, that's just me storing the unsubscribe method
Rank 1: Thread
so that I can call it at the end of the useEffect
Rank 1: Thread
useEffect(() => { getQuestionsFromDB();
const unsubscribe = client.subscribe( `databases.${DB_ID}.collections.${COLLECTION_ID}.documents`, (res) => { console.log({ res });
if ( res.events.includes( "databases.*.collections.*.documents.*.update" ) ) { setQuestions((prevQuestions) => { return prevQuestions.map((question) => { if (question.$id !== res.payload.$id) { return question; }
return res.payload; }); }); } console.log("UPDATED QUESTIONS"); } );
return () => { unsubscribe(); };}, []);Rank 1: Thread
this is the entire useEffect inside of my App.jsx
Rank 1: Thread
this code worked, I haven't changed anything but then the event stopped firing
Rank 1: Thread
are there any limitations? 🤔
Rank 1: Thread
btw, the update method works too, I just don't get the realtime event and I have to manually refresh the page
Moderator
If i remember it well, the only limitation was that you can't have a lot of simultaneous connections
Moderator
But I think it's not the case
Moderator
Thai is Appwrite cloud, right?
Rank 1: Thread
no, I'm just testing this on localhost
Rank 1: Thread
yes
Moderator
Ok. Do you can send me your project ID?
Rank 1: Thread
sure: 6694b8f8000ff3696830
Moderator
cc @Steven
Rank 1: Thread
ok, now it seems to be back
Rank 1: Thread
🤷♂️
Rank 1: Thread
no changes in my code
Moderator
Steven will take a look soon into it to check logs and see if there's an issue from Appwrite's side and your specific project
Rank 1: Thread
thank you
Moderator
Maybe it's an issue with your network 🤔🤷♂️
Moderator
No idea, sincerely 😅
Rank 1: Thread
well, I can chat with you here and all the other apps that are connected to the internet are working fine 😅