HomePhabricator
Diffusion Comm d436a37a6e69

[lib] Fetch message to preview from MessagePreview

Description

[lib] Fetch message to preview from MessagePreview

Summary:
In a later diff, we'll need to potentially call an async function to fetch a message from the database in order to determine which message should be the MessagePreview.

The code in chat-selectors.js isn't async, and it would be rather complicated to convert it to be.

Instead, in this diff I move the logic for determining which message to preview to the MessagePreview components that actually render the message.

Depends on D13825

Test Plan:
Tested in combination with the rest of the stack:

  1. Make sure membership operations (user joining / leaving) don't appear in MessagePreview
  2. Make sure reactions to the viewer's messages still appear in MessagePreview
  3. Make sure reactions to other user's messages don't appear in MessagePreview
  4. Test fresh login to thread with only one message in the last 14 days, which is a reaction to a non-viewer message. Make sure the reaction initially appears in MessagePreview, but then is replaced after more messages are fetched by the client

Reviewers: tomek

Reviewed By: tomek

Differential Revision: https://phab.comm.dev/D13826

Details

Provenance
ashoatAuthored on Tue, Oct 29, 11:09 AM
Reviewer
tomek
Differential Revision
D13826: [lib] Fetch message to preview from MessagePreview
Parents
rCOMM2d8f294a5d38: [native] Handle rendering "No messages" inside MessagePreview
Branches
Unknown
Tags
Unknown