Back

[Functions] x-appwrite-user-id different from actual user.$id as per the event

  • 0
  • Web
elnur
25 Oct, 2023, 11:07

The x-appwrite-user-id header in the request seems to contain an ID (...7f28) different from the user document ID (...2e4b) in the users collection. It looks like the x-appwrite-user-id is not the user document ID that I'm trying to delete.

Given the event is users.truncatedfordemo2e4b.delete, I might be able to extract the user ID from the x-appwrite-event header instead to get the correct ID (...2e4b) of the document to delete.

Is this a bug?

TL;DR
The user is experiencing an issue where the x-appwrite-user-id in the request header is different from the actual user document ID they are trying to delete. They are wondering if this is a bug. The solution suggested is to extract the user ID from the x-appwrite-event header instead to get the correct ID of the document to delete.
elnur
25 Oct, 2023, 11:07

[Functions] x-appwrite-user-id different from actual user.$id as per the event

elnur
25 Oct, 2023, 11:08

Perhaps because I'm deleting the user document myself in the dashboard...

elnur
25 Oct, 2023, 11:08

Then it would be a different user correct?

otik
25 Oct, 2023, 13:06

Yes it is probably that

Drake
25 Oct, 2023, 14:27

If you're deleting via the console, you're deleting as your console user so it will be the id of your console user

Drake
25 Oct, 2023, 14:29

Btw, the body of an execution triggered by an event should contain the related payload. So in your case, it should be the deleted document

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