Oh you're using Appwrite cloud?
[SOLVED] Appwrite Updating File Error
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 3: Container
yes
Oh you don't need the set self signed then.
Rank 3: Container
oh ok I'll remove that line of code
Rank 3: Container
So the console log of the process.env.APPWRITE_ENDPOINT is "https://cloud.appwrite.io/v1"
The console log on the response of the newFilePermission inside getProductDocument function is:
New Permission created {
'$id': '64fbe41ede6fd6d2ecbb',
bucketId: '64f9387bc57202784544',
'$createdAt': '2023-09-09T03:18:55.369+00:00',
'$updatedAt': '2023-09-09T04:50:44.468+00:00',
'$permissions': [
'read("user:64de92862ee341ef5a77")',
'update("user:64de92862ee341ef5a77")',
'delete("user:64de92862ee341ef5a77")'
],
name: 'uwuuu.png',
signature: '35d9be18d9c3d4510a126b62e2de85ef',
mimeType: 'image/png',
sizeOriginal: 1850419,
chunksTotal: 1,
chunksUploaded: 1
}
And it does change the $updatedAt variable.
Also the create documents and update does work, im currently testing it on my localhost, the only one that doesnt work is the one for updating the permissions of the file.
Rank 3: Container
Also i console log the buyer and the ownerOfProduct, buyer="64fbde728881b69372bc", ownerOfProduct=" 64de92862ee341ef5a77"
Rank 3: Container
Here on the appwrite cloud permissions of that file is still the same, theres only the creator permission that automatically creates with the file security, but still not the buyer permissions there
Can you update it here?
Did you make this change too?
Rank 3: Container
yes
Rank 3: Container
Do you mean if it lets me update from the cloud, like manually?
Yes
Rank 3: Container
yes it does let me update from the cloud manually
Rank 3: Container
what could be happening?
im baffled...it definitely is updating since updatedAt gets updated. and write operations work as create document and update document work.
you're using the node SDK, right? what version?
Rank 3: Container
im using node-appwrite version 11.0.0
Rank 3: Container
could it be that it is adding the permission to the user, but it does not show it in the cloud or in the console? or is that impossible?
It should show
Would you please use 8.1.0?
Ya I'm pretty sure this is the problem
Rank 3: Container
it works
Rank 3: Container
thank you very much Steven, but why does it not work in version 11.0.0?
11.0.0 is meant for Appwrite 1.4 where we added support for updating the file name. So, that parameter you were passing was name rather than permissions
Rank 3: Container
oh i see, thanks
[SOLVED] Appwrite Updating File Error