You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message: Handle moved messages from UpdateMessageEvent.
We already handle the case where only a message's content is edited.
This handles the case where messages are moved too, between topics
and/or channels.
This introduces more notifyListener calls, and the listeners can be
notified more than once per UpdateMessage event. This is expected.
---
If the `generation += 1` line is commented out, the message list
has a race bug where a fetchOlder starts; we reset (because
messages were moved into the narrow); and then the fetch returns
and appends in the wrong spot. These races are detailed in the "fetch
races" test group.
---
StreamMessage.displayRecipient no longer carries the up-to-date display
name of the stream when the message has been moved to another stream. We
invalidate it by setting it to null.
The only time StreamMessage.displayRecipient is useful is when we
don't have data on that stream. This is the reason why we don't go ahead
and lookup the stream store when such a stream move happen, because the
stream store likely will not have that information if we ever need to
use displayRecipient as the fallback.
---
We have relatively more tests for the topic moves, because there are
more cases that make a difference to consider. There is some overlap
between the tests like "(channel, topic) -> (new channel, new topic)" and
other tests where only one of topic/channel is changed. We include both
because the parameterized test cases are easy to modify and it doesn't
hurt to cover another realistic scenario handled by the same code path.
Co-authored-by: Zixuan James Li <[email protected]>
Signed-off-by: Zixuan James Li <[email protected]>
0 commit comments