Page MenuHomePhabricator

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

Authored by rohan on Oct 10 2023, 8:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 10:06 PM
Unknown Object (File)
Wed, Nov 20, 4:38 PM
Unknown Object (File)
Wed, Nov 20, 4:38 PM
Unknown Object (File)
Wed, Nov 20, 4:36 PM
Unknown Object (File)
Wed, Nov 20, 4:18 PM
Unknown Object (File)
Mon, Nov 18, 2:08 PM
Unknown Object (File)
Mon, Nov 18, 11:28 AM
Unknown Object (File)
Sun, Nov 10, 1:52 PM
Subscribers

Details

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).

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable