
Hi all,
I am self-hosting an Appwrite instance with the version 1.6.1 on a remote server and am running a web-app written in React in a container on the same host. My web-app is using node-appwrite version 13.0.0.
On one page, I need to be able to render information about all users so I use a Server Page to call Users.list to get all users to then pass that over to the Client Page.
That means, my page.tsx I have this code:
const prefs = await getAllUserPreferences();
return <ClientPage userPreferences={prefs} />
}
where the method getAllUserPreferences() looks like this:
// src/lib/server/appwrite.js
"use server";
import { Account, Client, Query, Teams, Users } from "node-appwrite";
export async function getAllUserPreferences() {
const client = new Client()
.setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT)
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT)
.setKey(process.env.NEXT_APPWRITE_KEY);
;
const users = new Users(client);
let filteredUserList = []
let userList = await users.list([Query.limit(100)])
for (const user of userList.users) {
const prefs= users.getPrefs(user_id)
filteredUserList.push({ $id: user.$id, name: user.name, preferences: prefs, email: user.email });
}
return filteredUserList;
}
Usually this works without any issues. If a new user registers though, this new user is not included in the return from users.list(). E.g., today a new user registered himself on my Web App and when I now open this page, I only get the information for every other user but not the new one.
The strange thing with this issue is that I only get it on the live Web App. If I build my project locally and run it, I always get all users. Also, after I update my App and upload it to live, it works as well.
I also checked if there is some caching that is interfering but I was able to exclude that as a reason.
Does anybody have an idea what causes this?
Recommended threads
- Explore uploaded images directly from lo...
Is there any option to explore/dwonload uploaded files to from local machine? I connected through WinScp to my vps and to files from docker volume 'appwrite_app...
- The current user is not authorized to pe...
I'm just getting this error while it was working couple minutes ago, my users have permissions to access and create tables data but on some databases I'm just g...
- Migrate Appwrite
I have appwrite setup in Coolify, where my dev and production both are running on coolify due to upgrade issues and multiple issues when deployed with coolify. ...
