Back

[SOLVED] Realtime no response

  • 0
  • Web
  • Realtime
Hexi
22 Aug, 2023, 17:08
TypeScript
onMount(async () => {
    let transactions = await database.listDocuments(
      env.PUBLIC_VAULT_DB_ID,
      env.PUBLIC_TRANSACTIONS_COLLECTION_ID
    );
    console.log(transactions);
    client.subscribe(
      `databases.${env.PUBLIC_VAULT_DB_ID}.collections.${env.PUBLIC_TRANSACTIONS_COLLECTION_ID}.documents`,
      (response) => {
        console.log(response);
      }
    );
  });```
I am trying to get this realtime to get to work and it seems to connect to the websocket but it just doesnt respond with anything
TL;DR
The user was trying to get a realtime response from their console, but it wasn't working. They discovered that realtime events won't trigger changes done in the console. The user suggests mentioning this in the documentation. There is a sample code provided that connects to the realtime and updates a document. The issue seems to be that the realtime gets disconnected. The user also mentions that the list documents function works fine. No solution is provided in the thread.
Hexi
22 Aug, 2023, 17:10

(for in context the list documents works fine)

Binyamin
22 Aug, 2023, 17:10

Is the users has permission for the documents and the sub documents?

Hexi
22 Aug, 2023, 17:10

it does seem like realtime gets disconnected

Binyamin
22 Aug, 2023, 17:10

Have you create/update/delete new documents in that collection?

Binyamin
22 Aug, 2023, 17:11

Mmm This is your <:kubernetes:781202441546629180> instance?

Hexi
22 Aug, 2023, 17:11

Nah I just went with a dedicated node

Hexi
22 Aug, 2023, 17:11

it was just too fittely to get that working great

Binyamin
22 Aug, 2023, 17:12

Yes, agreed

Hexi
22 Aug, 2023, 17:12

I update one of the documents their number

Hexi
22 Aug, 2023, 17:13

Update this payment amount

Hexi
22 Aug, 2023, 17:14

Does this look normal to you? shouldnt it respond back like there is a connection or doesnt appwrite do that?

Binyamin
22 Aug, 2023, 17:15

No, that's okay

Binyamin
22 Aug, 2023, 17:16

Just wanted to verifiy that

Binyamin
22 Aug, 2023, 17:17

It seems like if you're changing something in the console it **__won't__** fire realtime events

Binyamin
22 Aug, 2023, 17:17

Connect to the <:realtime:1108648060894068776> realtime and update the document using any SDK or REST api

Hexi
22 Aug, 2023, 17:20

oh okey let me try that

Binyamin
22 Aug, 2023, 17:20

If it's true that the real time won't trigger changes done in the console maybe it's worth to mention it in the docs

Hexi
22 Aug, 2023, 17:21

Ah that worked ^^

Binyamin
22 Aug, 2023, 17:21

Great

Binyamin
22 Aug, 2023, 17:21

So it's indeed the way it works

Hexi
22 Aug, 2023, 17:21

[SOLVED] Realtime no response

Hexi
22 Aug, 2023, 17:22

Thanks! Thought the console would act the same but it doesn't really matter in my case

Binyamin
22 Aug, 2023, 17:22

<a:agooglethumbsup:635256484682530825>

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