[SOLVED] Creating collection with Server SDK and reading from it on Client SDK
- 0
- Flutter
- Functions
- Cloud
I am creating collection by function execution and then check if execution was successful then get its documents but hence leads to unauthorized_scope error. Remember users permissions are provided in server side function execution. After HotReload everything works fine and same user can get all documents from newly created Collection.
I think after successful execution of functions which creates Collection, it's attributes, indices and set Permissions, "completed" status is returned while permissions are not created yet. @Moderator
Seems like the user doesnt has permission for a document?
If you have appwrite 1.3.x upgrade to the last version 1.3.4, since previous had a problem with permissions migration
@Hassanmrwt could you share the code for this function?
Sure
Full code in file
Function works fine, completes it's execution but accessing newly created Collection's documents throws permissions error
okay here's what i can think of
in your function code, you're not await-ing every call to create attributes, etc.
which is causing the code to jump through without even checking if the execution of each call was complete. And hence you get the status: ok
what i would do is
Find a way to cheat my code Closed the code in try {
from where error is thrown
db.listDocuments() }on AppwriteException { called the same above code again and works fine }
šš
await each of these calls amd try again. might slow it down a little, but might work!
Yes this could be the exact error let me go through this again and see what's happen
not exactly a good practice for production š
Yes
let me know! if i stop replying, I've fallen asleep š it's way past my bed time lmaoooo
Have nice dreams š¤
Yes š did work š
Just awaited on creating attributes and index
Sounds good!
[SOLVED] Creating collection with Server SDK and reading from it on Client SDK
Recommended threads
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...
- Create a new paid tier
Current pricing seems reasonable enough about what is someone getting for 25$. But for some people most of these resouces are getting wasted. Like the bandwidt...
- [Bug] Appwrite Auth User Prefs
User prefs are decoded as blank although there are plenty of data and add preference button not working in this case