slackapi / slackapi/node-slack-sdk
How to prevent channels with the same name from being created?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.4k
- Forks
- 688
- Avg merge
- 15h 31m
- Merged PRs (30d)
- 27
Description
I expected that 2 calls to conversations.create at the same time would get one of them to fail, but instead 2 channels were created with the same name and different IDs. If I later try to make a 3rd call it fails with name_taken.
Packages:
Select all that apply:
-
@slack/web-api -
@slack/rtm-api -
@slack/webhooks -
@slack/oauth -
@slack/socket-mode -
@slack/types - I don't know
Reproducible in:
The Slack SDK version
6.8.1
Node.js runtime version
18.12.1
OS info
ProductName: macOS
ProductVersion: 12.5.1
BuildVersion: 21G83
Darwin Kernel Version 21.6.0
Steps to reproduce:
You can run this code:
const results = await Promise.all([
client.conversations.create({token, name: 'duplicated-channel-name2', validate: true}),
client.conversations.create({token, name: 'duplicated-channel-name2', validate: true})
]);
and inspect results
Expected result:
An error on one of the calls.
Actual result:
Both calls generated channels with the same name but different IDs. A later third call succeeded again but the fourth failed with name_taken.


Requirements
/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the Promise.all reproduction with @slack/web-api 6.8.1 on Node.js 18.12.1 and inspect the returned results. Compare concurrent and sequential conversations.create calls to establish the name_taken behavior; done means determining whether the behavior is in the SDK or Slack API and documenting the confirmed outcome.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100