-
-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
outbox: Show outbox messages when 'caughtUp.newer' is false. #4179
Conversation
Interesting, thanks for this PR, and the debugging that led to it, @agrawal-d! Over at #3800 (comment), you said:
I traced the origin of this bit of logic to b23628a, which links to #1262. Neither the commit nor the PR offers any explanation at all, which is unfortunate—not only because it doesn't tell us the motivation for this particular change, but because, looking at the commit, it seems plausible that there are numerous other changes associated with this change, and those are also unexplained. These days, we have much stricter standards about what gets committed, and it pays off even if it feels a bit laborious to get things right. 😄 Do the changes in b23628a suggest to you that there might be more work to be done in this PR, if the goal is to undo the work of the commit message, "Do not show outbox if not caught up"? |
For the reason for b23628a, I have one guess. You said:
Very true. Then:
I mostly agree, but I suppose there's an argument for not showing them directly following some messages that we know might be old. While we're loading new messages, we might mistakenly think that the outbox messages are going to be sent directly following some messages that may be old in any of several ways, e.g.:
That being said, if we're still retrying sending some messages, then our latest knowledge of the narrow should be...reasonably up-to-date, I think? The latest knowledge will likely line up with the time you first tried to send the messages. And we shouldn't be constantly retrying for an unreasonable amount of time (that's #3829, I think). With this in mind, I think it's probably okay to proceed as we do in this PR. But does that sound reasonable to you? |
Thanks for the link to the original change. Yikes, the PR gives no explanation at all on why the change was made!
Yeah, I agree, if I responded to message X with a message Y, and Y is still in the outbox, it is very unlikely that there are un-fetched messages between X and Y. An if there is a UX penalty for showing Y, the UX penalty for not showing Y is much higher, I think. And if I am replying offline, then I will be reasonably aware that the messages shown are not latest. What would be very bad UX is that I sent a message when offline, and it disappeared. I think both logics have drawbacks, but I feel the current logic has more drawbacks than my proposed one. |
Currently, we return a NULL_ARRAY in outboxMessagesForNarrow when 'caughtUp.newer' is false - but there is no reason to do this. We should always show outbox messages regardless of the caughtUp state because there can always be unsent messages for various reasons. So, remove the conditional that causes this. Fixes: zulip#3800.
Linking to discussion. |
Closing as the solution discussed in the link above is very different to the one proposed in this PR. |
Thanks @agrawal-d for driving this forward! If you'd like to tackle giving an error on send in this condition as discussed at that chat link, that would be excellent 🙂 |
@gnprice sure! Working on it. |
(And that's #4208.) |
Currently, we return a NULL_ARRAY in outboxMessagesForNarrow when
'caughtUp.newer' is false - but there is no reason to do this. We
should always show outbox messages regardless of the caughtUp state
because there can always be unsent messages for various reasons.
So, remove the conditional that causes this.
Fixes: #3800.