fix(types): correct three ApiRocketChat return types - #433
Open
arbazkhan971 wants to merge 1 commit into
Open
arbazkhan971 wants to merge 1 commit into
arbazkhan971 wants to merge 1 commit into
Conversation
getRoomIdByNameOrId returns the response body, not a room id string. channelInfo and privateInfo already unwrap the channel/group; drop the Promise casts that made their types Promise<Promise<...>>. Fixes RocketChat#381 Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes the three return-type bugs in
ApiRocketChatfrom #381.getRoomIdByNameOrIdwas typed asPromise<RID>but returns the REST body (the existing test pins this: "answers its result untouched"). The signature now matches that body. Rocket.Chat.ReactNative does not call this helper, so I did not unwrap to an id (that would be a behavior change).channelInfo/privateInfoalready unwrap.channel/.group. Theas Promise<...>casts afterawaitmade the declared typesPromise<Promise<...>>. They are nowPromise<IChannelAPI>andPromise<IGroupAPI>.Test plan
lib/api/__tests__/RocketChat.spec.tsstill records current runtime (25/25)npm run lintnpm run typecheckFixes #381
Made with Cursor