-
Notifications
You must be signed in to change notification settings - Fork 662
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
How to prevent channels with the same name from being created? #1589
Comments
Hi @ofmycwt thanks for writing in 🥇 and thanks for the detailed issue! I have been able to reproduce this on my end as well, it seems to be an unexpected behavior since this does not appear in our other SDKs (tested with deno-slack-sdk) Here is the script I used to test this, using a const { WebClient } = require('@slack/web-api');
const run = async () =>{
const client = new WebClient();
const results = await Promise.all([
client.conversations.create({
token:
"xoxp-...",
name: "duplicated-channel-name2",
validate: true,
}),
client.conversations.create({
token:
"xoxp-...",
name: "duplicated-channel-name2",
validate: true,
}),
]);
console.log(results);
}
run(); and this is the output I got [
{
ok: true,
channel: {
id: 'C...',
name: 'duplicated-channel-name2',
is_channel: true,
is_group: false,
is_im: false,
is_mpim: false,
is_private: false,
created: 1675876063,
is_archived: false,
is_general: false,
unlinked: 0,
name_normalized: 'duplicated-channel-name2',
is_shared: false,
is_org_shared: false,
is_pending_ext_shared: false,
pending_shared: [],
context_team_id: 'T...',
updated: 1675876063681,
parent_conversation: null,
creator: 'U...',
is_ext_shared: false,
shared_team_ids: [Array],
pending_connected_team_ids: [],
is_member: true,
last_read: '0000000000.000000',
topic: [Object],
purpose: [Object],
previous_names: [],
priority: 0
},
response_metadata: { scopes: [Array], acceptedScopes: [Array] }
},
{
ok: true,
channel: {
id: 'C...',
name: 'duplicated-channel-name2',
is_channel: true,
is_group: false,
is_im: false,
is_mpim: false,
is_private: false,
created: 1675876063,
is_archived: false,
is_general: false,
unlinked: 0,
name_normalized: 'duplicated-channel-name2',
is_shared: false,
is_org_shared: false,
is_pending_ext_shared: false,
pending_shared: [],
context_team_id: 'T...',
updated: 1675876063703,
parent_conversation: null,
creator: 'U...',
is_ext_shared: false,
shared_team_ids: [Array],
pending_connected_team_ids: [],
is_member: true,
last_read: '0000000000.000000',
topic: [Object],
purpose: [Object],
previous_names: [],
priority: 0
},
response_metadata: { scopes: [Array], acceptedScopes: [Array] }
}
] |
Update: we have created an internal issue for this, a patch to the Web API should be coming soon 🥇 |
@WilliamBergamin thanks, is there any update on this? |
Still no update, for the time being I would suggest not using |
I have the same issue using Java SDK. We have a microservice architecture with different instances of the SDK, so a patch to the SDK will probably not solve the problem for us. |
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized. |
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized. |
As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number. |
Hey can we please get an update on this. Its still creating multiple channel with same name. |
There has been no updates for this for this issue, please send a request to prioritize the bug fix to [email protected] |
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 withname_taken
.Packages:
Select all that apply:
@slack/web-api
@slack/rtm-api
@slack/webhooks
@slack/oauth
@slack/socket-mode
@slack/types
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:
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
/
The text was updated successfully, but these errors were encountered: