zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

Improve tests for Model._handle_message_event

Open kaustubh-nair opened this issue 4 years ago • 6 comments

This should hopefully be a fix for #642 #574 and #566

kaustubh-nair avatar May 24 '20 15:05 kaustubh-nair

@neiljp Thanks for the review, I've pushed the updated commits.

kaustubh-nair avatar May 24 '20 19:05 kaustubh-nair

@kaustubh-nair Thanks for working on this 👍 . I tried some manual testing and the results are promising.

One follow-up point worth mentioning here (in case you or someone else wants to pick it) is to try and bridge the 'holes' in index forming which this might trigger. For instance, the new logic will solve the negative unread_count issues we have been seeing, but suppose we index a non-current message which is received and then the user scrolls down (keypress down) causing new message to be fetched, how will the index handle this? Will the re-index cause any problem since the message may potentially exist already in the index?

This don't need to be solved right away, but it's worth keeping in mind of the impact the PR may have on index related items.

sumanthvrao avatar May 25 '20 04:05 sumanthvrao

@kaustubh-nair I just pushed the code part of this PR, since this is an important fix that I don't want to leave unmerged for too long - both because it improves the overall experience, and since it may expose other bugs.

Let's discuss whether you want to leave this PR open to improve the tests for this method, or whether to add this as another issue so we don't forget it.

neiljp avatar May 27 '20 22:05 neiljp

@neiljp Pushing some commits for refactoring tests now.

PS. If you think the current commits don't require any more changes, you can merge them. I'll add commits on top.

Edit: Oh, you did push the commit didn't see that. Okay, I'll add the tests then.

kaustubh-nair avatar May 28 '20 07:05 kaustubh-nair

The main commit here was merged, so renamed the PR. Does need a rebase though.

kaustubh-nair avatar Jul 29 '20 15:07 kaustubh-nair

Heads up @kaustubh-nair, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main branch and resolve your pull request's merge conflicts accordingly.

zulipbot avatar Jan 30 '21 20:01 zulipbot