HomePhabricator
Diffusion Comm 36fc0ddd0799

[lib] Introduce a canBeSidebarSource function in each message spec

Description

[lib] Introduce a canBeSidebarSource function in each message spec

Summary:
The last part of unifying the logic and source of truth for determining eligible messages to be sidebar sources is to have a canBeSidebarSource function in each message spec. This diff introduces the constant to each existing message spec, and the next diffs will replace the logic in to isInvalidSidebarSoruce to call the message spec. This ensures that we'll only ever need to update the specific message spec in one place and the ValidRawSidebarSourceMessageInfo type if we ever want to change this.

Depends on D9324

Resolves https://linear.app/comm/issue/ENG-5208/introduce-a-canbesidebarsource-function-in-each-message-spec

Test Plan: Ran flow and updated the unit tests to call canBeSidebarSource. yarn workspace lib test passes all tests

Reviewers: atul, ginsu

Reviewed By: ginsu

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D9325

Details

Provenance
rohanAuthored on Oct 10 2023, 7:53 AM
Reviewer
ginsu
Differential Revision
D9325: [lib] Introduce a canBeSidebarSource function in each message spec
Parents
rCOMM992a50e084d1: [lib] Update types for SIDEBAR_SOURCE messages to reflect isInvalidSidebarSource
Branches
Loading...
Tags
Loading...