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
F2899968: D9445.id31879.diff
Sat, Oct 5, 8:43 AM
Unknown Object (File)
Sun, Sep 15, 1:13 PM
Unknown Object (File)
Sun, Sep 15, 1:13 PM
Unknown Object (File)
Sun, Sep 15, 1:12 PM
Unknown Object (File)
Sun, Sep 15, 12:54 PM
Unknown Object (File)
Sep 1 2024, 2:34 PM
Unknown Object (File)
Aug 23 2024, 3:39 PM
Unknown Object (File)
Aug 14 2024, 5:42 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
Branch
ENG-4849
Lint
No Lint Coverage
Unit
No Test Coverage