You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chat-client: HTTP POST https://chat-us-east-1.stream-io-api.com/users?api_key=<secret> status 400 Bad Request: {\"code\":4,\"message\":\"UpdateUsers failed with error: \\\"users[<userid>].online is a reserved field\\\"\",\"exception_fields\":{\"users[<userid>].online\":\"users[<userid>].online is a reserved field\"}
It seems like if that is reserved, it should be omitted?
The text was updated successfully, but these errors were encountered:
@ferhatelmas absolutely. The issue, primarily, is that there is no way to strip out anything "reserved" or to know what is actually reserved if you're just trying to update an existing record after fetching it. i.e.:
Get User
Update user model
Re-Save user
It's actually impossible to do this use case btw. It will fail every time (hence this ticket).
In the above scenario, it will contain the entire user record and any attributes / values that may/may not be reserved.
It might be useful to have an update struct to differentiate between a user and what the API requires. e.g.:
typeUserUpdateOptionsstruct {
// allowed values here
}
This way you can create a set of "safe" options that can be updated.
Your suggestion sounds reasonable at first but we already have a partial update and it's in that direction so if a client knows what to (un)set, it's the preferred way to accomplish that.
In the example flow, anything reserved should be filtered automatically or to save some work from SDKs, server can ignore them.
/cc @thesyncim what do you think about ignoring in server side ?
If you first grab a user record like so:
Then modify the user and attempt to save it, like ..
It will fail with the following error:
It seems like if that is reserved, it should be omitted?
The text was updated successfully, but these errors were encountered: