Skip to content

Commit

Permalink
[lib] Hide initialThreadState.memberIDs from GENESIS
Browse files Browse the repository at this point in the history
Summary:
We hide the members list of GENESIS. For similar reasons, we should hide the list of initial members.

This addresses [ENG-9430](https://linear.app/comm/issue/ENG-9430/hide-initialthreadstatememberids-list-on-genesis); more context there.

Test Plan: I added an `|| true`, and then logged out and back in on `web` and confirmed that all thread creation robotext were missing "and added A and B" at the end

Reviewers: varun, will

Reviewed By: will

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D13528
  • Loading branch information
Ashoat committed Sep 30, 2024
1 parent 8f8315d commit 336252d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/shared/messages/create-thread-message-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
type RobotextParams,
} from './message-spec.js';
import { assertSingleMessageInfo } from './utils.js';
import genesis from '../../facts/genesis.js';
import { messageTypes } from '../../types/message-types-enum.js';
import type {
ClientDBMessageInfo,
Expand Down Expand Up @@ -56,13 +57,21 @@ export const createThreadMessageSpec: CreateThreadMessageSpec = Object.freeze({
},

rawMessageInfoFromServerDBRow(row: Object): RawCreateThreadMessageInfo {
const threadID = row.threadID.toString();
let initialThreadState = JSON.parse(row.content);
if (threadID === genesis().id) {
initialThreadState = {
...initialThreadState,
memberIDs: [],
};
}
return {
type: messageTypes.CREATE_THREAD,
id: row.id.toString(),
threadID: row.threadID.toString(),
threadID,
time: row.time,
creatorID: row.creatorID.toString(),
initialThreadState: JSON.parse(row.content),
initialThreadState,
};
},

Expand Down

0 comments on commit 336252d

Please sign in to comment.