Document Update Success in Cloud Function Logs but Not Reflected in Database
- 1
- Self Hosted
- Functions
Hello Appwrite Support Team,
I hope this message finds you well. I've encountered an issue related to updating a document in my Appwrite database via a cloud function.
I am currently using Appwrite version 0.12.4.202. I am attempting to update a document using a cloud function. Post-update, within the same function, I'm fetching the document from the database and printing the changed value to ensure the changes have been applied. According to the cloud function logs, this change appears to have been executed successfully, every time. However, when I inspect the document directly in the Appwrite console, the expected changes do not always happen.
While the change is consistent in the cloud function logs, it's reflected in the actual database only about 3/4th of the time. Interestingly, this inconsistency occurs even when the exact same user performs the actions in an identical manner.
This intermittent nature of the issue is puzzling, and I'm trying to understand the root cause. Please help me. Thank you.
bump
First, if can it's much recommend the upgrade to latest version (remember to upgrade and know the migration increment process)
As for your use-case How do you know that the transaction was indeed success, can you share the function code?
`db = Database(client); storage = Storage(client); Order order = Order.fromJson((await db.getDocument( collectionId: orderCollectionID, documentId: orderId)) .data);
order.status = 'COMPLETED';
await db.updateDocument( collectionId: orderCollectionID, documentId: order.id!, data: order.toJson()); print('Order Status Updated!'); Order orderVer = Order.fromJson((await db.getDocument( collectionId: orderCollectionID, documentId: orderId)) .data); print("ORDER STATUS CHECK: " + orderVer.status);`
and the function logs say:
Order Status Updated!
ORDER STATUS CHECK: COMPLETED
Meaning that it is updated, but somehow "reverts back"? I don't get it. Note that it works sometimes and does not sometimes
What langauge it is?
FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.
Dart
are there audit logs for the document? it might be in the appwrite console, in the document...maybe one of the tabs
Recommended threads
- It says domain already used but I have d...
I accidentally deleted the project in which I used my domain originally (orexia.app) from name.com. Now I am trying to add it to a different project and it says...
- Is this normal in the self host custom d...
when i try to add custom domain to the project did not see this in 1.8.0 ok when pressed the retry it says "DNS verification failed with resolver 8.8.8.8. Domai...
- No server error on selfhosted appwrite
Please help me, my clients is ask what happen on their data? How can i make it up again?