Skip to content
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

[v3] Return to a single enum for channel modes #1954

Open
lawrence-forooghian opened this issue Jan 21, 2025 · 0 comments
Open

[v3] Return to a single enum for channel modes #1954

lawrence-forooghian opened this issue Jan 21, 2025 · 0 comments
Labels
breaking Backwards incompatible changes made to the public API.

Comments

@lawrence-forooghian
Copy link
Collaborator

lawrence-forooghian commented Jan 21, 2025

Split from #1952.

From #1955:

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).

If we choose lowercase we need to update the ably.com documentation, which uses uppercase: https://ably.com/docs/channels/options#modes

┆Issue is synchronized with this Jira Task by Unito

@lawrence-forooghian lawrence-forooghian added the breaking Backwards incompatible changes made to the public API. label Jan 21, 2025
lawrence-forooghian added a commit that referenced this issue Jan 21, 2025

Verified

This commit was signed with the committer’s verified signature.
lawrence-forooghian Lawrence Forooghian
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.
lawrence-forooghian added a commit that referenced this issue Jan 21, 2025

Verified

This commit was signed with the committer’s verified signature.
lawrence-forooghian Lawrence Forooghian
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.
lawrence-forooghian added a commit that referenced this issue Jan 22, 2025

Verified

This commit was signed with the committer’s verified signature.
lawrence-forooghian Lawrence Forooghian
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.
@VeskeR VeskeR changed the title Return to a single enum for channel modes [v3] Return to a single enum for channel modes Jan 23, 2025
lawrence-forooghian added a commit that referenced this issue Jan 27, 2025

Verified

This commit was signed with the committer’s verified signature.
lawrence-forooghian Lawrence Forooghian
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Backwards incompatible changes made to the public API.
Development

No branches or pull requests

1 participant