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

createPublicChannel should join channel if the name already exists #43

Closed
valeriansaliou opened this issue Jan 26, 2024 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@valeriansaliou
Copy link
Member

The JSDoc for createPublicChannel on the JS SDK says that: https://gist.github.com/nesium/f1c21dfb0d345b8c223017f418343a4e#file-prose_sdk_js-d-ts-L482

I'd expect that calling eg. createPublicChannel("support") where #support already exists, would let me join the channel, as the JSDoc states. However, I'm getting this error: A public channel with the chosen name exists already.

@valeriansaliou valeriansaliou added the bug Something isn't working label Jan 26, 2024
@nesium
Copy link
Contributor

nesium commented Jan 26, 2024

I admit that the documentation doesn't match the actual behavior. It is sometimes hard to design the API without seeing the actual UI. I've now changed my opinion a bit about the behavior and think that it could be confusing if you were thrown into an existing channel without any notice when you thought that you were creating a brand new channel instead.

From that POV I think Slack's interface makes total sense:

If we'd want to add a bit of convenience we could still add another button that would allow to join the existing channel.

What do you think? Change the documentation or the behavior of the method?

@valeriansaliou
Copy link
Member Author

Sounds good! I'll also need a method to check if a channel already exists, returning eg. a boolean or JID.

@nesium
Copy link
Contributor

nesium commented Jan 26, 2024

Added Client::findPublicChannelByName

As the name suggests finds only public channels. Refs prose-im/prose-pod-system#4

@nesium nesium closed this as completed Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants