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)
Mon, Nov 25, 7:56 AM
Unknown Object (File)
Nov 22 2024, 1:09 PM
Unknown Object (File)
Nov 10 2024, 9:06 PM
Unknown Object (File)
Nov 10 2024, 8:46 PM
Unknown Object (File)
Nov 10 2024, 7:05 PM
Unknown Object (File)
Nov 10 2024, 7:44 AM
Unknown Object (File)
Nov 10 2024, 7:19 AM
Unknown Object (File)
Nov 7 2024, 12:41 PM
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) {
  ...
}