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

Fix handling un-read count for un-indexed messages.

Open sumanthvrao opened this issue 5 years ago • 5 comments

This PR is a step in the direction of fixing #395.

TODO: Add tests

sumanthvrao avatar Jun 20 '19 13:06 sumanthvrao

@amanagr provided you pointed out the incorrect fix in #393, what do you think of this approach

sumanthvrao avatar Jun 20 '19 13:06 sumanthvrao

Thanks @sumanthvrao. I just checked the response we receive from the server and it includes found_newest in it. This I found out is a new parameter which server gives us(https://chat.zulip.org/api/get-messages). So, while czo gives us this new parameter, older versions of the webapp will not, so we should primarily use found_newest to determine if we have fetched all the messages in the narrow, and then use the logic you came up with to determine if there are more messages to be fetched.

amanagr avatar Jun 20 '19 14:06 amanagr

Great. Will check it out :+1: !

sumanthvrao avatar Jun 20 '19 14:06 sumanthvrao

Updated this :+1:

@neiljp The first 3 commits here are quite independent, there were also some of the changes we were discussing in #393 . This includes, a small indentation change (commit 1), renaming update to found_newest, which is also the variable the API returns (@punchagan what do you think of this name?) and fixing it as a property of model (commit 2) , and making use of the found_newest to update the flag (Thanks for the information @amanagr ) (commit 3)

The later commits (Last 2) are sort of techniques I came up with, which works for now (regardless of them being the best solution). I would love to have your feedback on them.

sumanthvrao avatar Jun 26 '19 06:06 sumanthvrao

Heads up @sumanthvrao, 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/master branch and resolve your pull request's merge conflicts accordingly.

zulipbot avatar Apr 17 '20 00:04 zulipbot