appwrite: 🐛 Bug Report: Total count of documents in collection does not update when document created from web SDK

👟 Reproduction steps

When using the Web SDK a frontend application create a document in a collection by using the method as outlined in the documentation:

appwrite.database.createDocument('collection_id', {})

Wherein the {} is shorthand for the object one wishes to create, which am assuming the user is structuring correctly as per the rules they created in the document collection.

In the documentation it states that read and write permissions are optional, however I have found that if read is omitted it results in some unintended behavior.

It should be noted that in my document collection read permissions are specified as a rule, but there is no way to set the read/write parameters as required or not in the console.

There are other issues pertaining to documents and collections in general, but in all of the issues currently labeled with bug none of the relevant issues mentioned this problem specifically, so I chose to open a new issue.

👍 Expected behavior

The documents total number should update despite the fact that the optional parameter is left blank, OR the documentation and method should be updated such that read parameters are required.

👎 Actual Behavior

When using the method .createDocument() without specifying read permissions, the actual list of documents is updated and a new document is created (increasing the sum parameter on the payload Promise<> delivered by .listDocuments()), however the console does not reflect the change in sum and does not update its totals in the browser.

This can be rectified by specifying any read permissions, such as ['*'] for example, or user:$id etc. When the read parameters are specified the total updates. The total also updates if the document is created from within the browser based console.

🎲 Appwrite version

Version 0.10.x

💻 Operating system

Windows

🧱 Your Environment

Running appwrite locally in docker desktop, built without errors, and all containers running without errors.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn’t find similar issue

🏢 Have you read the Code of Conduct?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (16 by maintainers)

Most upvoted comments

@TorstenDittmann , can this be reopened and addressed?

Looks like this should be fixed with the db refactor.