Page MenuHomePhabricator

[lib][native][web] Extract chatMessageItemKey
ClosedPublic

Authored by ashoat on Oct 9 2024, 8:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 1:09 PM
Unknown Object (File)
Sun, Nov 10, 9:06 PM
Unknown Object (File)
Sun, Nov 10, 8:46 PM
Unknown Object (File)
Sun, Nov 10, 7:05 PM
Unknown Object (File)
Sun, Nov 10, 7:44 AM
Unknown Object (File)
Sun, Nov 10, 7:19 AM
Unknown Object (File)
Thu, Nov 7, 12:41 PM
Unknown Object (File)
Thu, Oct 31, 1:28 AM
Subscribers
None

Details

Summary

This will make it easier to change its behavior in a later diff.

Depends on D13681

Test Plan

Flow

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ashoat requested review of this revision.Oct 9 2024, 9:43 PM
tomek added inline comments.
lib/shared/chat-message-item-utils.js
19–27

Do we need to specify messageInfos here?

This revision is now accepted and ready to land.Oct 11 2024, 6:06 AM
lib/shared/chat-message-item-utils.js
19–27

Yes, it's necessary. Without explicitly listing messageInfos here, Flow deduces that the ... can contain messageInfos. As a result, Flow isn't able to narrow the type when we do a check like this:

if (item.messageInfos) {
  ...
}