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)
Sun, Nov 10, 1:52 PM
Unknown Object (File)
Sun, Oct 20, 9:03 PM
Unknown Object (File)
Sat, Oct 19, 4:19 AM
Unknown Object (File)
Sat, Oct 19, 4:19 AM
Unknown Object (File)
Sat, Oct 19, 4:18 AM
Unknown Object (File)
Sat, Oct 19, 4:02 AM
Unknown Object (File)
Oct 6 2024, 3:23 PM
Unknown Object (File)
Oct 5 2024, 11:23 AM
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