-
-
Notifications
You must be signed in to change notification settings - Fork 286
Add unread_msgs structure to index #497
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
Conversation
|
@neiljp Initially, I was thinking of storing only the message_ids in the index, but I'm not sure how much of this extra information ( like |
|
@zulipbot add "in progress" |
|
@kaustubh-nair We know the extra information is there in the At a glance the code looks like it should broadly do the right thing, though we might be able to move things around and simplify them once it is more settled. You can probably squash the second commit with the first? |
47bc9e3 to
7d765fb
Compare
7c30341 to
a9876eb
Compare
neiljp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaustubh-nair You may want to investigate integrating this into classify_unread_counts and the UnreadCounts data, though currently this may work with the data being separate.
@neiljp Integrating it into |
3cbe2c4 to
6e229d2
Compare
neiljp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaustubh-nair This looks like being on the way to a good minimal approach 👍
I've left some comments on the changes as a whole only, as you've left your commits showing your different ideas and adjustments during development. That makes it more difficult to review them on a commit-wise basis as mergeable commits. Do you plan to restructure them? Let us know if you need more information on what I mean.
Do you plan to include the response to events in this PR, or build on this later? It might be easier here if it is not too complex, as you can ensure that the data structure has the appropriate elements.
neiljp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaustubh-nair This approach seems more straightforward; I've left some notes as the code seems a bit mixed between commits, but otherwise seems simpler 👍.
The commit flow might be more logically ordered as:
- adjust count updates to occur on read messages from server (just messages we have fetched) [currently commit 3]
- add the data structure support for keeping track of unread message ids, not just fetched ones [currently commit 1]
- use the new data structure to track the unread counts better [partly in commit 2]
The first two stages look reasonable so far, and you have part of the third in one commit. In addition to splitting commits cleanly, getting a readable 'flow' of commits helps with reviewing larger PRs where changes build on one another.
|
@neiljp I've reorganized the commits and fixed the other issues. The unread counts now get updated for indexed messages. The next step would be to store all the unread data in the index. Then, modify |
neiljp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaustubh-nair These look like good progress towards using the 'read' flag events 👍
I was thinking of just merging the first commit as it is, as it should be a good first step from using the workaround of set_count in the model method, to using the actual 'read' flag event, but given we're changing the behavior I'd like to get the tests a little better first - as per the inline comments.
The other factor is that your commit text could be generally improved, which I think I mentioned in your other PR.
The other commits look broadly good, but before we add them I'd prefer to see the intended use of the extra indexed data, to make sure we've got the right approach. Re next steps, I think we should be able to manage with just the unread message ids, and update when getting new messages?
|
@kaustubh-nair I'm not sure that |
|
@neiljp Some important points:
|
|
Hello @kaustubh-nair, it seems like you have referenced #496 in your pull request description, but you have not referenced them in your commit message description(s). When you reference an issue in a commit message, it automatically closes the corresponding issue when the commit is merged. Please run An example of a correctly-formatted commit: Thank you for your contributions to Zulip! |
Modified update_message_flag_status to update read flags. These work only for indexed messages, for now. Added tests for read flag status. Amended star flag status tests.
Modify classifu_unread_counts to return unread message ids. Add tests. Amend model tests.
Modify tests.
|
@neiljp I've fixed the tests. Also, I've added a comment above explaining a few other things |
|
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 |
|
@kaustubh-nair Thanks for getting this work going! 👍 I've merged the first commit as-is, but have expanded quite a bit on the commit text, as this feels like an important change. The commit is 013f898 🎉 While this just covers those in the index, this feels like a great first step :) If you'd like to work on the message-ids extension, then feel free to continue it in this PR, or elsewhere if you'd prefer to reduce the github noise. |
|
Re the message_ids, we do have this data to begin with in |
|
v2 is being continued in #535 |
Fixes #496