amitrochatesOriginal post
Rank 2: Process
Trying to use the users.listSessions as given here https://appwrite.io/docs/references/cloud/server-nodejs/users#listSessions
here's my code
Plain text
const result = await users.listSessions({ userId: userslist.users[0].$id });```
I wonder why im getting this error, my userId doesnt exceed 36 chars, nor does it have underscore in the beginning , heres whats logged in `userslist.users[0].$id``685add06748f633325b0`
Full Error: ```Error in purge-user-sessions function: AppwriteException: Invalid `userId` param: UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and underscore. Can't start with a leading underscore at _Client.call (file:///usr/local/server/src/function/node_modules/node-appwrite/dist/client.mjs:293:13) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Module.default (file:///usr/local/server/src/function/src/index.js:38:20) at async execute (/usr/local/server/src/server.js:220:16) at async action (/usr/local/server/src/server.js:237:7) at async /usr/local/server/src/server.js:26:5```
Edit: Add full error in the post messageSummary
AppwriteException is being thrown due to the `userId` param exceeding 36 chars, even though the length seems valid. The issue might be related to characters other than alphanumerics or incorrect leading underscore. Check code and potential data issues.