zulip-terminal
zulip-terminal copied to clipboard
Fix handling un-read count for un-indexed messages.
This PR is a step in the direction of fixing #395.
TODO: Add tests
@amanagr provided you pointed out the incorrect fix in #393, what do you think of this approach
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.
Great. Will check it out :+1: !
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.
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.