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
wip 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.
TODO: tests. There's a variety of kinds of test cases this needs,
but here's one in particular that may not be apparent:
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. Also a related race bug where it's
fetchInitial, and it lacks the moved messages. So there should be
test cases exercising each of those situations, which would fail if
that line gets commented out.
TODO for followup commits:
* Update StreamMessage.displayRecipient.
If we wanted, we could update it by looking up the new stream's
name. To enable MessageStoreImpl to do that, we'd pass it a
StreamStore, the same way we do with Unreads.
But in fact the only time displayRecipient is useful is when we
don't have data on that stream. So there's not much point in
looking it up here. Instead, make the field nullable, and just
set it to null when the message is moved between streams.
* Handle UpdateMessageEvent.propagateMode. This probably means
_MessageListPageState having its own notion of the current narrow,
which is initialized with `widget.narrow` but can change.
Then `_MessageListState._modelChanged` can check if the model's
narrow has changed, and if so tell the page state to update.
For comparison, see zulip-mobile's `src/events/doEventActionSideEffects.js`,
or web.
0 commit comments