element-hq / element-hq/synapse
Ignored users in `/sync` only returned with a delay after ignoring
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#9783](https://github.com/matrix-org/synapse/issues/9783).
---
### Description
I'm investigating a reload loop after ignoring a user in the Element iOS app and traced it down to a discrepancy in the `/sync` response. Apparently, after ignoring a user there is a delay before the ignored user shows up in the `/sync` response. The [spec](https://matrix.org/docs/spec/client_server/r0.6.1#id146) suggests that the ignored user should "immediately" be reflected in the response.
The code in [matrix-ios-sdk](https://github.com/matrix-org/matrix-ios-sdk/blob/develop/MatrixSDK/MXSession.m#L1559k) is written accordingly and expects the ignored user change on the first `/sync`.
### Steps to reproduce
- `PUT` `/_matrix/client/r0/user/@myuser:myhomeserver/account_data/m.ignored_user_list` to ignore a user
- `GET` `/_matrix/client/r0/sync?filter=0&timeout=0` (without a stream token) in a loop and notice how it takes a while until the ignored user is reported back
There's a minimal script that performs these steps [here](https://github.com/vector-im/element-ios/issues/4168#issuecomment-817125315). When using the script it takes a _long_ time (>1m) for the ignored user to show up. In the Element iOS app the delay is shorter (within seconds). I haven't figured out why but I suspect that one of the simultaneous API calls the app makes causes this as a side effect.
### Version information
- **Homeserver**: matrix.org
Contributor guide
Assessment
This issue has not been assessed yet.