Skip to content

Sending a self-PM causes flicker-jump in message list, via dupe in display_recipient #4301

Closed
@gnprice

Description

@gnprice

Repro:

  • Go to the self-PM conversation.
  • Send a message.
  • If that was the first message in this thread today (i.e. if a date separator appeared), send another.
  • Expected: The message appears in the message list, first with a spinner and then the spinner disappears.
  • Actual: The messages in the message list jump up and then back down; in the end the message appears as expected.

If you put the device in airplane mode, or otherwise cause sending to fail so the message stays in the outbox, you can see what's happening: the outbox message shows in the message list... with its own sender header with name and avatar, even when it's right after another message (which necessarily has the same sender, namely yourself.) If the send happens quickly, this shows up mostly as that flicker glitch, because the message is taller with the sender.

The root issue is that when constructing the display_recipient of an outbox PM, we're indiscriminately appending the self user after taking the list of users given in the Narrow value. Presumably this was motivated by the fact that display_recipient values for PMs list all participants including self, while for most PM narrows we leave out the self user... but for self-PMs, we don't. The result is that for self-PMs we produce a malformed display_recipient, consisting of the self listed twice.

The observed symptom then comes because in renderMessages, we see the outbox message has a different recipient from the previous one, and treat it as if we expected to show a recipient bar for it. (We don't actually show a recipient bar, but that causes us to show the sender header.)

Metadata

Metadata

Assignees

Labels

a-compose/sendCompose box, autocomplete, camera/upload, outbox, sending

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions