matrix-org / matrix-org/matrix-spec
Spec timeout threshold values for presence
- Dominant language
- HTML
- Stars
- 330
- Forks
- 150
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 3
Description
*As [@Half-Shot mentioned](https://matrix.to/#/!uNmnpKGxLDSeGLpyDR:half-shot.uk/$10RfohkVcO4AQ5280ELfYgJUL2JH5-gyblPs4k3uY4w?via=half-shot.uk&via=matrix.org&via=element.io), we ought to spec these out.*
**Link to problem area**:
https://spec.matrix.org/v1.1/client-server-api/#idle-timeout
> Idle timeout
>
>The server will automatically set a user’s presence to `unavailable` if their last active time was over a threshold value (e.g. 5 minutes). Clients can manually set a user’s presence to `unavailable`. Any activity that bumps the last active time on any of the user’s clients will cause the server to automatically set their presence to `online`.
**Issue**
Spec timeout threshold values for presence. For example, Synapse has made the following decisions but a client/bridge would have to use to use a minimum value that is compatible with other homeservers.
[`synapse/handlers/presence.py#L99-L111`](https://github.com/matrix-org/synapse/blob/a86b2f6837f0a067b0a014fbf5140e8773b8da2e/synapse/handlers/presence.py#L99-L111)
```py
# If a user was last active in the last LAST_ACTIVE_GRANULARITY, consider them
# "currently_active"
LAST_ACTIVE_GRANULARITY = 60 * 1000
# How long to wait until a new /events or /sync request before assuming
# the client has gone.
SYNC_ONLINE_TIMEOUT = 30 * 1000
# How long to wait before marking the user as idle. Compared against last active
IDLE_TIMER = 5 * 60 * 1000
# How often we expect remote servers to resend us presence.
FEDERATION_TIMEOUT = 30 * 60 * 1000
```
Contributor guide
Research direction
Start with the Matrix Client-Server API's idle-timeout section and compare it with the referenced Synapse presence.py constants. Determine which presence timeout thresholds need normative specification and document the agreed values and behavior in the relevant specification section.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100