Back

[SOLVED] RealTime API is not working in my application

  • 0
  • Web
  • Databases
  • Storage
  • Self Hosted
  • Users
musscodes
8 Sep, 2023, 01:10

i can see in dashboard but why im unable to see the log of that function in console

TL;DR
RealTime API is not working in my application. The solution is to make sure the string is one line and remove all the new lines inside the string templates. Additionally, ensure that you have subscribed only once, create new documents after subscribing, and that the user has access to the newly created document. Check if the application is self-hosted or cloud and how the client is initialized. Make sure the realtime messages are syncing between users and check the dashboard for connection status. Verify if the function log is visible in the console.
Binyamin
8 Sep, 2023, 01:11

I mean what do you see here?

musscodes
8 Sep, 2023, 01:15
musscodes
8 Sep, 2023, 01:16

yeh it shows connected

musscodes
8 Sep, 2023, 01:16

here you can see the realtime messages sync 2 users but messeges are not syncing

Binyamin
8 Sep, 2023, 01:20

That should work

  • Is this a self-hosted or cloud?
  • How are you initializing the client?
musscodes
8 Sep, 2023, 01:29
Binyamin
8 Sep, 2023, 01:31

Everything seems intact let's see what <:appwrite:637383039499894787> Steven would say

musscodes
8 Sep, 2023, 01:34

k

Drake
8 Sep, 2023, 01:38
  1. did you subscribe only once and after logging in?
  2. are you creating new documents after subscribing?
  3. does hte user have access to the newly created document?
musscodes
8 Sep, 2023, 01:51
  1. yep
  2. it can create document but not in realtime eg. when i press send it store in db .
  3. yes i have given access to any
musscodes
8 Sep, 2023, 01:52

here is the updated code what i tried

musscodes
8 Sep, 2023, 01:52
musscodes
8 Sep, 2023, 01:53
Binyamin
8 Sep, 2023, 01:54

Mmm now that I think of it Can you remove all the new lines inside the string templates?

Binyamin
8 Sep, 2023, 01:54

Change this to one line

Binyamin
8 Sep, 2023, 01:54
musscodes
8 Sep, 2023, 01:54

oh

musscodes
8 Sep, 2023, 01:56

like this?

Binyamin
8 Sep, 2023, 01:57

You can keep it on template string like so

TypeScript
client.subscribe(`databases.${DATABASE_ID}.collections.${COLLECTION_ID}.documents`);
Binyamin
8 Sep, 2023, 01:57

Just make sure the string is one line and let us know

musscodes
8 Sep, 2023, 02:00

gotcha

musscodes
8 Sep, 2023, 02:00

thank youuuu

Binyamin
8 Sep, 2023, 02:03

Great 😃

Drake
8 Sep, 2023, 02:23

[SOLVED] RealTime API is not working in my application

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more