From 6ae992d5866943a1cfc6610be3d65a79a197b90d Mon Sep 17 00:00:00 2001 From: April Hall Date: Sun, 9 Feb 2025 23:45:41 -0500 Subject: [PATCH] fix: Channel creation matching bug Bug where the channel creation dialog wouldn't throw an error if you typed the name of an existing channel that had hyphens, or a channel with the same name but spaces instead of hyphens. This is because channelnames are stores with underscores internally, and channelnames were not sanitized in the `checkChannel()` method on the `Db` class --- src/lib/server/db/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/server/db/index.ts b/src/lib/server/db/index.ts index fe1a5af..2bf2554 100644 --- a/src/lib/server/db/index.ts +++ b/src/lib/server/db/index.ts @@ -73,6 +73,7 @@ class Db { async checkChannel(channel: string): Promise { try { + channel = sanitizeChannelName(channel); const res = await this.client.execute(`SELECT table_name FROM system_schema.tables WHERE keyspace_name = 'channels' AND table_name = ?`, [ channel.toLowerCase(), ]);