Skip to content
Back

[SOLVED] Document cannot load

  • 1
  • Databases
  • Cloud
Mosh Ontong
19 Aug, 2023, 10:46

I will wait to othres to response to this issue, maybe the cloud backup is one of the root cause of this issue

TL;DR
The user is experiencing an issue where a document is not loading in their application. They created the document using a code snippet and noticed that when creating the document through the console, the issue does not occur. The user suspects that the permissions for the document may be the cause of the problem. They provided their code snippet for creating the document and mention "malformed permissions". The problem seems to be UI-related as the user is able to fetch the document's payload successfully on the server side. They also mentioned encountering errors in the console's dev tab and are unable to access the document's data in their dashboard. They point out that cloud backup
Mosh Ontong
19 Aug, 2023, 13:55

everyone

Mosh Ontong
19 Aug, 2023, 13:55

can someone help me to this issue

Mosh Ontong
19 Aug, 2023, 13:55

I am still encountering this issue

Eldad
19 Aug, 2023, 14:01

This shouldn't happen because of a backup. @Mosh Ontong do you get any errors in your browser? can you check using your devtools?

Also, are you able to access this doument using the API?

Mosh Ontong
19 Aug, 2023, 14:03

it actually successfully fetch the document based on the network tab and no error occurs but in my dashboard does not show the documents data

Eldad
19 Aug, 2023, 14:04

Can you share the document structure? It sounds like a UI problem if this is the case.

Mosh Ontong
19 Aug, 2023, 14:04

In I just check the console in dev tab right now this is the error

Mosh Ontong
19 Aug, 2023, 14:05

but fetching the payload in server no error occur

Mosh Ontong
19 Aug, 2023, 14:07
Eldad
19 Aug, 2023, 14:14

@Torsten Dittmann could you or someone from the console team take a look at this?

Drake
19 Aug, 2023, 15:12

The backups only cause problems with schema changes like creating an attribute or creating a collection

Drake
19 Aug, 2023, 15:12

That's the problem. Malformed permissions

Mosh Ontong
19 Aug, 2023, 15:19

what do you mean malformed permission? if it is how to fix then?

Drake
19 Aug, 2023, 15:20

It should be an array. You can try to update it

Mosh Ontong
19 Aug, 2023, 15:26

you are right I just created a dummy document, I create this dummy through console and yeah it sucessfully loaded. I think we should have feedback on console ui here if this issue occured, I cant delete this document because of this issue

Mosh Ontong
19 Aug, 2023, 15:31

This is my code to create a document

TypeScript
   final doc = await databases.createDocument(
        databaseId: super.bookingTimelineCredential.databaseId,
        collectionId: super.bookingTimelineCredential.collectionId,
        documentId: ID.unique(),
        data: bookingTimeline.toJson(),
        permissions: [
          Permission.read(Role.users()),
          Permission.update(
            Role.user(
              bookingTimeline.bookingRef.clientProfile.id,
            ),
          ),
          Permission.update(
            Role.user(
              bookingTimeline.bookingRef.service.ownerId,
            ),
          ),
          Permission.delete(
            Role.user(
              bookingTimeline.bookingRef.clientProfile.id,
            ),
          ),
          Permission.delete(
            Role.user(
              bookingTimeline.bookingRef.service.ownerId,
            ),
          ),
        ],
      );

Every I create a document then this malformed will always occur? But when I create document through console the malformed permission will not occur

safwan
19 Aug, 2023, 15:33

Ah yes that makes a lot of sense 😅

Drake
19 Aug, 2023, 15:35

The thing is we should never let the permissions get malformed so it's a backend problem, not a console problem

Drake
19 Aug, 2023, 15:36

Maybe the client id and the owner id were the same?

Mosh Ontong
19 Aug, 2023, 15:45

yes it is

Drake
19 Aug, 2023, 15:46

For now, you'll need to make sure you're passing unique values. On our end, we'll need to handle this better

Mosh Ontong
19 Aug, 2023, 15:46

ok this will be noted thanks steven

Mosh Ontong
19 Aug, 2023, 16:59

[SOLVED] Document cannot load

Drake
21 Aug, 2023, 21:58

btw, looks like this fix will be in appwrite 1.4.0: https://github.com/appwrite/appwrite/issues/5661

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