Skip to content

Commit

Permalink
Rename thick_sidebar -> dm_sidebar
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marcinwasowicz committed Sep 9, 2024
1 parent 81d288c commit 6fdb407
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/shared/thread-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/thread-utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);

Expand Down Expand Up @@ -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');
});
});
2 changes: 1 addition & 1 deletion lib/utils/validation-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6fdb407

Please sign in to comment.