element-hq / element-hq/element-web

Apparently we are sending way too many typing notifications

Open
#29,107 2 comments 0 reactions 0 assignees View on GitHub
O-Occasional S-Minor T-Defect X-Needs-Investigation
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

https://git.pixie.town/f0x/synapse-edulimit has been created as a c2s proxy which ratelimits typing notifications. However, the actual reason it's needed seems to be that EW sounds like it is sending way too many typing notif events. In theory, we should be sending an update when the user starts typing, and then a keepalive every ~30s, and/or a cancellation when they clear the composer.

But in practice

> just the short bit of typing I did in this room, with 751 homeservers, would've sent 21028 HTTP requests so far

says https://matrix.to/#/!QQpfJfZvqxbCfeDgCj:matrix.org/$MRlYWUiNL0ib2gyPD40r16zVY1mxFDgR6Gm_5BeGams?via=matrix.org&via=envs.net&via=element.io

which sounds like 28 typing notifications just by sending 3 messages in a room.

f0x said:

> ⁦it seems very quick to detect that you stopped typing, which is then immediately followed by having to send another request because you started again⁦      ⠀

Which sounds like we might have a regression in the debouncing.

### Outcome

#### What did you expect?

Typing notifs shouldn't DoS your server, let alone other servers.

#### What happened instead?

The act of typing a string of messages sent 50K HTTP hits in #twim. Which feels excessive.

### Operating system

_No response_

### Application version

Element Nightly version: 2025012301 Crypto version: Rust SDK 0.8.0 (21f7cc7), Vodozemac 0.8.1

### How did you install the app?

_No response_

### Homeserver

_No response_

### Will you send logs?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.