Back

how to create document by execution priority

  • 0
  • General
  • Web
manazo
28 Nov, 2023, 08:57

I'm working on a chat system. like any other chat app, there's a high chance that the user will type out multiple messages before the first message is sent successfully. so in that case, we need to make sure we're creating the message documents by the user execution (press send button) time. As of now, I'm just calling a function to create the document. and what I noticed is, it doesn't maintain the execution time for now. so how can I achieve that?

this issue might not be so relatable to Appwrite, but I still decided to post it here as my app's whole backend is handled by Appwrite

Stack:

  • NextJS@13
  • Appwrite Cloud

lemme know if u need any more info to resolve this

TL;DR
The user is trying to create documents in a chat app based on the user's execution time. They are currently using a function to create the documents, but the execution time is not being maintained. They are wondering how to achieve this. They are using NextJS and Appwrite Cloud. No solution is provided in the thread.
Kenny
28 Nov, 2023, 14:51

So the issue you're having is that you're using something like createDocument and the $createdAt attribute on this document does not line up with the time you've pressed the send button?

manazo
29 Nov, 2023, 07:20

exactly

Kenny
29 Nov, 2023, 13:05

How far off is it? I guess you can add a new column and populate it with new date.new() or something but you’d have to account for the time zone offset

manazo
29 Nov, 2023, 16:13

that's why I'm thinking of creating the documents one after another instead of maintaining another new attribute with the timezone hassle

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