Skip to content
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

typing_self_typing is sent when user isn't typing #2001

Open
trygveaa opened this issue Aug 19, 2023 · 0 comments
Open

typing_self_typing is sent when user isn't typing #2001

trygveaa opened this issue Aug 19, 2023 · 0 comments
Labels
bug Unexpected problem or unintended behavior

Comments

@trygveaa
Copy link
Contributor

trygveaa commented Aug 19, 2023

Bug summary

The signal typing_self_typing continues to be sent a lot of times after the user has stopped typing, but as far as I can see it's not possible to distinguish between the notices sent when the user continues to type and the notices sent in the period after the user stopped typing and before typing_self_paused or typing_self_cleared is sent.

This is a problem for wee-slack because Slack doesn't have any support for sending a typing stopped message. You can only send a typing message, and Slack will display the user as typing until there's 6 or so seconds since the last typing message.

This means that if wee-slack sends a typing notice to Slack when it gets the typing_self_typing, the user will appear as typing for around 16 seconds after they stopped typing (typing.look.delay_set_paused + however long Slack shows you as typing after the last typing message).

Steps to reproduce

1. Use hook_signal("typing_self_*", ...) to listen for typing signals.
2. Type something in a buffer

Current behavior

You get a lot of typing_self_typing signals for typing.look.delay_set_paused seconds after you stopped typing.

Expected behavior

The typing_self_typing signal shouldn't continue to be sent when the user is not typing. Or alternatively, it should be possible to know how long time it was since the user last typed. You can use other signal to accomplish this, but it would be easier to use if you could just use the typing signals.

Suggested solutions

Use a timer with an interval of one second like now, but only run it once so you get at most one signal per second. And don't emit the signal if the user hasn't typed anything since the last signal.

So while the user is continuously typing, you'll get typing_self_typing once every second. But after the user stops typing, no more typing_self_typing signals are sent.

Additional information

Additionally, the typing_self_typing signal is sent several times per second. It looks like the intended behavior is to send it once per second, but now it's sent 2 times per second if typing.look.enabled_nicks is off and 3 if it's on. So if you just type something and immediately stop typing, the typing_self_typing signal is sent 21 or 31 times.


  • WeeChat version: 4.0.2
  • OS, distribution and version: Arch Linux
  • Terminal: kitty
  • Terminal multiplexer (screen/tmux/…/none): none
@trygveaa trygveaa added the bug Unexpected problem or unintended behavior label Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant