Skip to content
Back

Realtime for files() works almost well, but for tablesDB it does not

  • 0
  • 2
  • Web
  • Databases
  • Storage
  • Realtime
  • Self Hosted
MrT
14 Mar, 2026, 13:12

I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available.

Whats working:

  • Connection via websockets
  • Ping-pong in appwrite console
  • Ping-pong between my localhost app and the console
  • Channels.files() subscription receives wss updates

What's not working:

  • tablesdb subscription does not work at all
  • (response) => {} is not being called anyway

My setup:

  • selfhosted appwrite on backend.mydomain.com
  • tanstack-start client
TypeScript
const client = new Client();
client
    .setEndpoint(ENDPOINT)
    .setProject(PROJECT_ID);
export const account = new Account(client);
export const tablesDb = new TablesDB(client);
export const storage = new Storage(client);
export const realtime = new Realtime(client);

and for testing realtime I have a window when I can CRUD db entries, and also upload files. This is how i set up realtime for listening to tablesDb:

TypeScript
async function realtimeFn() {
  const subscription = await realtime.subscribe(Channel.tablesdb(DATABASE).table('genres').row(), response => {
      console.log(response.timestamp);
  });
  setActiveSub(subscription);
}

<button onClick={realtimeFn}>Subscribe</button>
<button onClick={() => activeSub?.close()}>Unsubscribe</button>
TL;DR
Realtime function works for files() but not for tablesDB. Consider using an older SDK version, such as 22.0.0 as a potential solution.
MrT
14 Mar, 2026, 13:13

now when i hit subscribe, I can see the following messagess in devtools (see attachment):

  • type: connected with data being channels, and user: null
  • type: authentication, with data: <session token>
  • type: response to authentication: success - true
  • keepalive (ping-pong) ongoing

When I change name (for example the 'Blues2' folder to 'Blues') nothing is happening. No wss message received, nor the response callback is triggered.

It works quite different when working with files. I can change my function to listen to Channels.files():

TypeScript
async function realtimeFn() {
  const subscription = await realtime.subscribe(Channel.files(), response => {
      console.log(response.timestamp);
  });
  setActiveSub(subscription);
}

and as before i get connection, auth, and auth response, and ping-pong keepalive ongoing. But now when I for example upload or delete a file, I get the websocket message.

But either way, the response => {console.log(response.timestamp)} is never triggered.

MrT
14 Mar, 2026, 13:15

Here is the screenshot for Channels.files() subscription

MrT
14 Mar, 2026, 13:16

and for Channels.tablesdb..... nothing happends other than just keepalive

MrT
14 Mar, 2026, 13:17

I have the row security turned on, and create set to any role. When creating files in db I pass required permissions

TypeScript
const result = await database.create(data, {
    permissions(permission, role) {
        return [
            permission.write(role.user(userId)),
            permission.read(role.user(userId)),
            permission.update(role.user(userId)),
            permission.delete(role.user(userId)),
        ]
    },
})
MrT
14 Mar, 2026, 13:18

So based on my experience, there has been a slightly improvement to the realtime recently, but not everything works quite well, at least on self hosted instances.

MrT
14 Mar, 2026, 13:19

Realtime for files() works almost well, but for tablesDB it does not

15 Mar, 2026, 11:20

Ya use an older SDK

1
15 Mar, 2026, 11:37

Some specific version, or anything prior to the current version?

15 Mar, 2026, 12:16

Maybe 22.0.0

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