From 6fdb407d64188ce7e428ae681dca547900561386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20W=C4=85sowicz?= Date: Mon, 9 Sep 2024 14:59:45 +0200 Subject: [PATCH] Rename thick_sidebar -> dm_sidebar Summary: Rename thick_sidebar to dm_sidebar Test Plan: yarn jest thread-utils.test.js Reviewers: tomek Reviewed By: tomek Subscribers: ashoat Differential Revision: https://phab.comm.dev/D13268 --- lib/shared/thread-utils.js | 6 +++--- lib/shared/thread-utils.test.js | 4 ++-- lib/utils/validation-utils.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js index 989574c0ac..34b84907a3 100644 --- a/lib/shared/thread-utils.js +++ b/lib/shared/thread-utils.js @@ -397,7 +397,7 @@ function getPendingThreadID( ): string { let pendingThreadKey; if (sourceMessageID && threadTypeIsThick(threadType)) { - pendingThreadKey = `thick_sidebar/${sourceMessageID}`; + pendingThreadKey = `dm_sidebar/${sourceMessageID}`; } else if (sourceMessageID) { pendingThreadKey = `sidebar/${sourceMessageID}`; } else { @@ -425,7 +425,7 @@ function parsePendingThreadID( const [threadTypeString, threadKey] = pendingThreadIDMatches[1].split('/'); let threadType; - if (threadTypeString === 'thick_sidebar') { + if (threadTypeString === 'dm_sidebar') { threadType = threadTypes.THICK_SIDEBAR; } else if (threadTypeString === 'sidebar') { threadType = threadTypes.SIDEBAR; @@ -434,7 +434,7 @@ function parsePendingThreadID( } const threadTypeStringIsSidebar = - threadTypeString === 'sidebar' || threadTypeString === 'thick_sidebar'; + threadTypeString === 'sidebar' || threadTypeString === 'dm_sidebar'; const memberIDs = threadTypeStringIsSidebar ? [] : threadKey.split('+'); const sourceMessageID = threadTypeStringIsSidebar ? threadKey : null; return { diff --git a/lib/shared/thread-utils.test.js b/lib/shared/thread-utils.test.js index ec99f3fafa..b36e446f06 100644 --- a/lib/shared/thread-utils.test.js +++ b/lib/shared/thread-utils.test.js @@ -36,7 +36,7 @@ describe('parsePendingThreadID(pendingThreadID: string)', () => { memberIDs: [], sourceMessageID: '12345', }; - expect(parsePendingThreadID('pending/thick_sidebar/12345')).toStrictEqual( + expect(parsePendingThreadID('pending/dm_sidebar/12345')).toStrictEqual( thickSidebarResult, ); @@ -210,6 +210,6 @@ describe('getPendingThreadID', () => { it('should return correct ID from thick sidebar input', () => { expect( getPendingThreadID(threadTypes.THICK_SIDEBAR, [], '12345'), - ).toStrictEqual('pending/thick_sidebar/12345'); + ).toStrictEqual('pending/dm_sidebar/12345'); }); }); diff --git a/lib/utils/validation-utils.js b/lib/utils/validation-utils.js index ec5509ba57..acef697ff1 100644 --- a/lib/utils/validation-utils.js +++ b/lib/utils/validation-utils.js @@ -112,7 +112,7 @@ const uuidRegex = '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'; const idSchemaRegex = `(?:(?:[0-9]+|${uuidRegex})\\|)?(?:[0-9]+|${uuidRegex})`; -const pendingThreadIDRegex = `pending/(type[0-9]+/[0-9]+(\\+[0-9]+)*|(sidebar|thick_sidebar)/${idSchemaRegex})`; +const pendingThreadIDRegex = `pending/(type[0-9]+/[0-9]+(\\+[0-9]+)*|(sidebar|dm_sidebar)/${idSchemaRegex})`; const thickThreadIDRegex: RegExp = new RegExp(`^${uuidRegex}$`); const chatNameMaxLength = 191;