-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
bugfix: Fix wildcard_mentions not showing in mentions narrow. #1038
Conversation
ba4d273
to
d09d458
Compare
@zee-bit This looks effective after a quick manual test 👍 As per messages on the stream, I think it'd be useful to ensure through a test that the event handling code handles the behavior correctly of adding/removing these message flags. This sort of updates already via scrolling but not automatically, and the event code looks like it won't behave properly in all cases, so this may be updated behavior belonging in a new commit. We likely want it to behave the same as for starred messages, ie. add but not remove, until leaving and returning to the narrow. A related point to that above is that we could use a Another related point - perhaps for the first commit? - is that we may want to explore expanding other tests to incorporate this message flag. That'll be both checking for tests with |
d09d458
to
7c85a09
Compare
7c85a09
to
b37a885
Compare
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.
@zee-bit I started some feedback on this so wanted to get a little more out to you. I've not looked at the last commit.
Having flags internally as a set may make things simpler for us, though I've not examined how much of a refactor it would be.
b37a885
to
2ca4b32
Compare
2ca4b32
to
5b525a4
Compare
5b525a4
to
bc9e4e2
Compare
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.
@zee-bit Just a quick bit of feedback tonight while I have time - independently of the bugfix, I'm looking forward to the refactor of mentions fixture as well as the extra api typing 👍
bc9e4e2
to
904c272
Compare
@zee-bit The refactoring first is great, and I've cherry-picked that first commit 👍 I don't like that we introduce a broken state after the second commit - and the subsequent commit is a little unclear too in terms of whether it's fixing that broken state or something else. If you can introduce some wildcards without breaking things then you could, then update the params with more values next - but I suspect that's not that useful. I'd suggest just adding some mixed data to the new fixture and fixing the code to make tests pass - in one commit. Then if there's a separate bugfix to make, add that - along with a new test case? |
(Just cherry-picked the first flag types commit too) |
904c272
to
88bb614
Compare
88bb614
to
3be2349
Compare
@zee-bit Another cherry-pick after cleaning the commit text to simplify the bug text - it should be accurate, but it's easier if you can do this more yourself. I think you referenced various different bugs? I'd recommend checking it out and we can discuss. I would have merged the rest but we shouldn't depend on just indexed messages for the count to update - if I edit a message which isn't indexed then the mentioned unreads don't change currently or with the remaining commit(s). |
1da9a3d
to
dacdeda
Compare
We may need to get the remaining commits (or, at least the second one) in before I can push a fix for the un-indexed message bug, cause the new field that I'm working on locally needs to be updated when flags are changed through |
This commit updates the index and unread_count if the message was indexed when an update message event with change in mention flag(s) is detected. If the message was not in index, we just update the unread_count. In this case, the count is updated by comparing with initial_data's "unread_msgs" field which does not stay synced with the server, hence the logic is buggy. Changes in mentioned narrow after this event are not rendered at the same time but it updates the model so that a return to the mentioned messages narrow will do so. The tests are also tried to be modified as less as possible, and the present fixtures were mostly used to test for this new condition, thus preventing the use of too many fixtures. Tests amended.
This commit expands some of the fixtures of present tests with the mentioned/wildcard_mentioned flags to make the tests more robust and generalized.
dacdeda
to
f75075a
Compare
The rest of the PR is protracted to #1068, along with the un-indexed message bugfix. |
The server defines several wildcard_mentions like @all/@everyone/@stream, which are not marked with 'mentions' in the message flags, rather 'wildcard_mentions'. This bugfix PR now checks for this flag in the message response from the server and appropriately categorizes these messages as mentioned and also updates the count in the respective narrows.
Fixes #1037