Unable to update metadata on user but can create - Resolved

EDIT - This was a setting on our end, I’ll leave this up in case anyone searches and has the same issue, this can be disabled in the dash board… oops!

I receive an error when attempting to modify any metadata on my current user

I can create metadata just fine for a user using, sb.currentUser.createMetaData however if I attempt any changes on that created data using deleteMetaData or updateMetaData I get the following error:

{
    "error": true,
    "message": "Not authorized. \"User update is not allowed from clients.\".",
    "code": 400108
}

Simplified example

    const handleStatusChange = async (status: string) => {
        const data: MetaData = {
            status,
        };
        if (sb.currentUser) {
            await sb.currentUser.updateMetaData(data);
            //  await sb.currentUser.createMetaData(data); <--- always errors, even when upsert true or false is set.
        }
    };

[Sendbird Chat version]
4.12.3
[UIKit Version]
3.14.3

[Reproduction Steps]
Attempting to update or delete any metdata

[Frequency]
Every time

[Current impact]
Unable to have a user modify their metadata.

Hello @jbrowncalled, and welcome to the Sendbird Community.

The error message you are receiving is due to the Allow updating user metadata ACL being disabled on your application.

Please navigate to your application Settings, then to Security, and make sure this setting is enabled.

1 Like