Rank 2: Process
now it got completed quickly
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
now it got completed quickly
Rank 2: Process
and got same error
Rank 2: Process
{
"success": false,
"error": {
"code": 400,
"type": "attribute_not_available",
"response": {
"message": "Attribute not available: timestamp",
"code": 400,
"type": "attribute_not_available",
"version": "0.10.45"
}
}
}
Rank 2: Process
not sure how to fix this now.
Yes, There is one more thing to add
One sec I'll update the snippet
Rank 2: Process
okay, thank you
Done
Rank 2: Process
okay, let me try again.
Rank 2: Process
finally, it worked! 🎉
Rank 2: Process
just putting my code here for future reference for other devs:
Rank 2: Process
Rank 2: Process
thank you so much both of you for helping me!!
Rank 2: Process
[Solved] Cloud function Fails to create index
Rank 2: Process
one last question,
Rank 2: Process
what will happen when the attribute stays in a processing state for minutes?
Rank 2: Process
because there is a function timeout of 15 seconds. so will it fail? or should I use self-hosted instead of cloud?
you should make sure to handle that case. at the moment, on cloud, it can take up to 30 minutes when there is a db backup going on
I'm no sure about your use case.
But, you can:
N minutes, that will work best with what Steven said about timing.databases.*.collections.*.attributes.*.create event, then add an index to that attribute.
It probably won't be good to extended the timeout time for a function like so.
If you need right now - as thing will, from what I've understand, be different when cloud's out of beta - then you can go the self-hosted route.
Rank 2: Process
my use case is for one-one chat conversation.
Rank 2: Process
every time when new user creates a chat, my cloud function executes and creates collection, storage bucket and all other stuff in the function code.
Rank 2: Process
including index
Rank 2: Process
so i can't make user wait for long. or else chat will not work
I see, that's keep thing the same. You just need to choose the right approach to handle the holding time.
The other approach could be by using teams, roles and leverage Appwrite permission with few collections to start with, check these:
Rank 2: Process
thanks for this, I have already a working chat system, just needed to fix that cloud function error. let me show you some screenshots, it's in Flutter and Appwrite.
I haven't used the Team feature yet, so I'm just giving permission to only conversation participants to access the conversation colletion.