-
-
Notifications
You must be signed in to change notification settings - Fork 273
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: Don't send and display typing updates from oneself. #1011
Conversation
@prah23 I can reproduce this issue - thanks for finding it and proposing a solution 👍 If I type in the webapp, then it does currently generate an event - shown in ZT on My concern is whether this solution is where the fix is ultimately important, or if it should be:
Given the webapp doesn't show self-self typing notifications, I assume this is a minor bug in the server in a corner case, that should likely be fixed there, and we could skip sending such notifications in the first place instead of not acting on the events. Even if the server doesn't change event handling and we adjust our sending, that would then leave the only case being "someone" typing in your account somewhere else triggering our event handling, which is then even more of a corner case. However, let's see what the server code looks like and if it's considered a bug there, for that case? |
Further context for anyone reading, this was discussed further at |
d16633a
to
021bb9a
Compare
021bb9a
to
e5dfe97
Compare
e5dfe97
to
fcbc20b
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.
@prah23 Just checking in on this small edge-case PR from a while back - it's well-structured and works fine, just a few queries before we merge 👍
zulipterminal/ui_tools/boxes.py
Outdated
# Updates server on PM typing events | ||
# Is separate from recipient_user_ids because we | ||
# don't include the user's own id in this list | ||
self.typing_recipients: List[int] = [] |
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.
This is nice simple extra variable which works fine. My only thoughts are:
- Maybe append
_user_ids
to indicate more clearly what's in it elsewhere - Should it be reset everywhere that recipient_user_ids is? It doesn't currently appear to be? (I know they have different uses, but it seems useful to be consistent)
- If we're resetting/setting at similar times, should that be in a function, existing or otherwise? (maybe a refactor?)
Prior to this commit, typing events from oneself were handled and displayed on the footer. This commit adds an extra check in the typing event handler's conditional to verify that the sender isn't the logged in user themselves before displaying the update. Tests added.
Prior to this commit, typing updates were sent to all recipients of the current private message as specified in `recipient_user_ids`, which is an unnecesary expense for the server though minute. This commit uses another list, `typing_recipient_user_ids`, that stores all the `recipient user_ids` except for the user's own, that can be used to send typing updates. This list is initiated as a part of WriteBox for persistence to send start and stop updates. Tests added.
This commit adds a helper method to synchronously set both types of recipient user_ids stored in WriteBox instances, namely, `recipient_user_id`s and `typing_recipient_user_ids`.
fcbc20b
to
78f42e6
Compare
@prah23 See my comment in the stream - I've also rebased this to resolve the minor conflict. This seems like an easy merge if my proposed changes look good to you 👍 |
First commit:
displayed on the footer. This commit adds an extra check in the
typing event handler's conditional to verify that the sender
isn't the logged in user themselves before displaying the update.
Tests added.
Second commit:
Prior to this commit, typing updates were sent to all recipients of
the current private message as specified in
recipient_user_ids
,which is an unnecesary expense for the server though minute.
This commit uses another list,
typing_recipients
, that stores all therecipient user_ids except for the user's own, that can be used to send
typing updates. This list is initiated as a part of WriteBox for
persistence to send start and stop updates.