-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] /api/v1/me returns only preferences that are not default #10481
Comments
I know it can become a mess having default values hard coded on each client, but not returning them from APIs also helps saving client's bandwidth. what @RocketChat/core thinks about this? should we have the logic spread on each client or should we make clients use a bit more data? |
Had to sit on this one and think a while.... But I have an opinion 😄 I think what ever the current value is, default or otherwise... we probably should send. For the sake of the clients especially in case of: @rocketchat/ios @rocketchat/android I think the amount of bytes saved here aren't going to be worth the extra work of having to implement in every client. This is a topic for another time. But I think we should combine all settings needed for any client into a single endpoint to decrease the number of calls needed for any client(even the web client) to get up and running. Instead of having to make multiple subscriptions and wait on preferences, and settings both to be delivered over a websocket. But that's just an extra 2 cents. |
I'm conflicted on this one. I feel like the user's preferences should be passed alongside the default ones to each client, but what happens when the server changes the type of the setting/preference? And how will the clients handle the possibility of different types of the values? Or do we need to make a very pointed effort to not change types of preferences anymore and instead deprecate ones and add new ones to replace the deprecated one? |
I can see your points @sampaiodiego, @geekgonecrazy, @graywolf336... IMHO, we don't need to save bandwidth on this situation, because all clients need this data in order to work correctly. This argument doesn't make any sense when we know that if the setting changed, the data is actually returned, and no bandwidth is saved. In order to save bandwidth, I believe need to put effort on fields that no client care about. I see two main advantages in having the default values being returned on the APIs:
Regarding your comment about changing values @graywolf336: I think it's not a problem to add a new value to a preference and setting it as the default one. The more we can communicate it, the better. But the clients can "protect" itself from getting invalid values and use some default that makes sense in case they receive a value not expected. |
@RocketChat/core Any updates on this one guys? |
We already have hard time on mobile with attributes that are not always the same type like when there is just one value it is an object and when there are more it is an array of objects, fields that you are expecting a boolean and get a String. on Android, at least, ideally I'd have a model like this
and that's it, this will auto generate an effiecient mapper from/to Json to Java/Kotlin object. So please, anytime when changing the type, create a new value and deprecate the old one. Not only for settings. About saving bandwidth we could have a query just like in public settings, requesting only the preferences that the client care about... Just for example, the new Android App asks just this settings
|
@MarcosSpessatto we need to make sure all user preferences have a default in the admin settings, so there is nothing hardcoded on the UI. Should @karlprieb and @ggazzo be involved here? |
@engelgabriel recently we decided to drop the settings for |
oh darn 🤦♂️ I had a local instance where a migration did not run so I had two settings for |
It doesn't make sense for us to hardcode the default settings in our client.
We should receive all preferences, not only the ones that changed.
Issue in the docs for reference:
https://github.com/RocketChat/docs/issues/695
The text was updated successfully, but these errors were encountered: