-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fix typings for RealtimeChannel.modes
#1955
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes modify the TypeScript type definitions for channel modes in the Changes
Assessment against linked issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (6)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
👍 with one comment
@@ -853,19 +853,19 @@ declare namespace ChannelModes { | |||
/** |
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.
Maybe worth leave a link to this pr or #1954 in the docstring comment for ChannelModes to explain the redundant values
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.
Done 👍
For some reason, this property returns lowercased values. So, reflect this in the typings. This is the only non-breaking change we can make, since: - if we change the return value of RealtimeChannel.modes to be uppercase, that will break things for users who are checking this return value against a list of lowercase values (having previously observed that this property returns lowercase values even though it contradicts the typings) - if we change the ChannelModes type to be lowercase, then we break things for TypeScript users who are setting `modes` in their channel options I have also changed the ChannelModes type to indicate that it accepts lowercased values; this allows a user to pass a ResolvedChannelModes when setting `modes` in their channel options. In our next major release, we should remove this duplicate type and only allow a single case (probably lowercase, since that's what we use for all of the other enum values in this SDK). Have created #1954 for this. Resolves #1952.
778bfe5
to
bf3c202
Compare
For some reason, this property returns lowercased values. So, reflect this in the typings. This is the only non-breaking change we can make, since:
if we change the return value of
RealtimeChannel.modes
to be uppercase, that will break things for users who are checking this return value against a list of lowercase values (having previously observed that this property returns lowercase values even though it contradicts the typings)if we change the
ChannelModes
type to be lowercase, then we break things for TypeScript users who are settingmodes
in their channel optionsI have also changed the
ChannelModes
type to indicate that it accepts lowercased values; this allows a user to pass aResolvedChannelModes
when settingmodes
in their channel options.In our next major release, we should remove this duplicate type and only allow a single case (probably lowercase, since that's what we use for all of the other enum values in this SDK). Have created #1954 for this.
Resolves #1952.
Summary by CodeRabbit
New Features
ResolvedChannelMode
type for more flexible channel mode handling.Improvements