-
Notifications
You must be signed in to change notification settings - Fork 13k
chore: deprecate getUserRoles saveCustomFields setReaction setUsername saveUserProfile setUserPassword methods
#36146
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e9c76e2
fix: Update username change restriction to allow editing only if the …
ggazzo ddeb1da
fix enforce 2fa only if requirePasswordChange is not set
ggazzo e901b64
fix: Add logic to unset requirePasswordChange for users after profile…
ggazzo 74bcb81
feat: Add `rooms.getRoles` endpoint and update related methods and hooks
ggazzo 8443d63
feat: Implement `users.getPublicRoles` endpoint and update related au…
ggazzo d6b0b9f
refactor: Update import path for metrics in deprecationWarningLogger.ts
ggazzo 44a8d90
chore: remove useMethod saveUserProfile setUsername saveCustomFields …
ggazzo d67b6e8
chore: remove useMethod setReaction
ggazzo 9daac84
chore: depreacte getRoomRoles method and use new endpoint
ggazzo aaf8bbc
refactor: Replace `getUserRoles` method
ggazzo f8a1f49
refactor: Update ResetPasswordPage to use new `users.updateOwnBasicIn…
ggazzo 4b512e4
refactor `findByRoomIdAndRoles` to return the projection properly
ggazzo fc4b2d2
review
ggazzo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid blocking additional properties on endpoints unless you have a specific reason to (like passing the whole params object along to something else).
with
additionalProperties: false, if we need to add an additional param in the future, it would need to be flagged as a breaking change, while withadditionalProperties: truewe can still add new params without necessarily breaking compatibility.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additional parameters will never be considered breaking change, removing or saying that extra is no longer supported may be the case.
the default is to not accept extra fields, and it wouldn't be the first case where people pass extra fields believing that something different happens works while it doesn't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just following what was decided on the backend chapter meeting. If we don't accept extra fields and then add a new one on a minor release, clients will need to pass a different set of params for different server versions, even though they are in the same major.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a new field is added as required, yes, that is a breaking change, if you add an optional one, thats fine.
but how accepting infinite fields with no use because the client may already be passing it is a bit pointless, how will the client already be passing a field with coherent data of something that does not exist and not need to modify it? How would the client already be passing something in advanced without knowing what should be passed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what happened in the past was our client (Rocket.Chat frontend) was passing extra information, pure laziness ours
'We have an object here, send it all something will be used the rest must be discarded-or no', but for me this is a lazy and not recommended reason, this is legacy of the lack of type and
anyusage, but it should not happen anymoreUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a client application uses an extra parameter introduced in a minor version, that means the client is not backward-compatible with versions prior that minor. If it aims to be compatible across a whole set under a major
X.*version, it has to use the interface/contract of the initial minor (X.0), without extra parameters. It's normal to assume an extra parameter will be consumed and impact the response; breaking this expectation by swallowing the extra parameter is bad.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok by having
additionalProperties: falsefor this particular endpoint since it is a new one, but we need to be careful if we ever change it.. I agree being more permissive (byadditionalProperties: true) is something that makes the whole development cycle easier since it doesn't bring any concerns regarding breaking changes and legacy clients, I also see value on being more restrictive as this ensures a tighter contract and removes the risk of having code using a non-documented field.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and I think we should all agree with whatever definition we come up with and document it so people understand the reasoning behind the decision and also provides a guide for us all when defining the schemas for our endpoints