Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
narrow: Re-normalize group PM user-set in isMessageInNarrow.
In most places in the app, we represent a group PM conversation by just the users in it *other* than self. This aligns with how the webapp represents the narrow in the URL: the fragment may look like `#narrow/pm-with/101,104-group` for a conversation with a total of 3 users in it. In particular, most of our code consistently generates group-narrow values following this convention, and in some places our code relies on that assumption. But we don't always fulfill it. One place we don't is when you open a notification for a group PM: the server represents the conversation there with the full list of users, and we don't normalize it to the other convention. Then one place we rely on the assumption is here in `isMessageInNarrow`... which we use to decide whether a new message should be shown in the conversation. The result is zulip#4293, that the narrow doesn't see any replies you send or any further messages that arrive. The ultimate fix here is an overhaul of how we represent narrows, to something more structured, with more explicit, checkable, checked invariants. Pending that, we'll fix the issue at hand at both ends -- either one suffices to fix the issue, and each one potentially fixes other, unknown issues. In this commit, we fix the consumer of the data, to no longer rely on this assumption. Fixes: zulip#4293
- Loading branch information