React Developer
I did not thoroughly investigate, but the issue does not seem to stem from actual permission errors (despite the error message). My tables have table-level permissions set to create("users/verified"), with row-level security enabled. The rows in question also have read, write, update permissions for my user. There is a 2-way-relationship column, but the row on both ends of the relationship indeed have permissions for my user.
The 401 response message I see upon tablesDB.updateRow(...) is the following: The current user is not authorized to perform the requested action. But I can clearly see that the update is reflected in the row, despite the error indicating otherwise. Maybe it is not the actual update the fails, but another tangent operation that is triggered by the update, the error message from appwrite is not conclusive here.
I have implemented the following workaround to check for this (what seems to be a) false-positive, but it is definitely a band aid: (pseudo code)
try { await tablesDB.updateRow({..., data: {my_column: content}})} catch (error) { if (error instanceof AppwriteException && error.code === 401) { const verify = await tablesDB.getRow({..., queries: [Query.select(["my_column"])]) if (verify["my_column"] === content) { // The intended update worked, despite 401 error response } else { throw error // A genuine error } } else { throw error // A genuine error }}As I said, I did not have time to thoroughly investigate this issue to find a minimum example to reproduce this, but I still thought I would share it here, in case you would know what to investigate! We are on a self-hosted instance version 1.8.1.