HomePhabricator
Diffusion Comm ffb42e25ff75

[lib/web/native] Introduce isInvalidPinSource method that checks the…

Description

[lib/web/native] Introduce isInvalidPinSource method that checks the messageSpec.canBePinned

Summary:
Similar to isInvalidSidebarSource, we want an isInvalidPinSource method to check individual message specs and return the correct boolean. This diff introduces the function and updates the relevant callsites to call isInvalidPinSource rather than directly checking isComposableMessageType. This is in an effort to isolate all of the logic to a single source of truth.

Depends on D9444

Resolves https://linear.app/comm/issue/ENG-5214/introduce-isinvalidpinsource-method-that-checks-the

Test Plan:

  1. Ran flow
  2. Ran yarn workspace lib test
  3. Manual testing (confirming only text/media can be pinned client-side, confirmed invalid_parameters is thrown if an invalid message type is attempted to be pinned, confirmed general usage of the app doesn't cause any crashes, and confirmed both the pinned messages modal and the message serach modal don't show pin robotext).

Reviewers: atul, ginsu

Reviewed By: atul

Subscribers: ashoat, tomek, wyilio

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

Details