element-hq / element-hq/synapse

device_inbox never gets emptied

Open
#3,599 2 comments 0 reactions 0 assignees View on GitHub
A-Database A-Disk-Space S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

To-device messages remain in `device _inbox` until the message is either successfully delivered (as indicated by the client sending a sync token which indicates that it must have received the message), or the recipient device is deleted.

It's therefore possible to accumulate a significant number of to-device messages which are unlikely ever to be delivered, because the recipient device no longer exists (but has not been explicitly logged out). (Related: https://github.com/element-hq/synapse/issues/8263).

---

This issue has been migrated from [#3599](https://github.com/matrix-org/synapse/issues/3599).

Contributor guide

Open the contributing guide

Research direction

Start by tracing where the to-device message inbox is stored and where delivery is confirmed by a sync token. Compare that lifecycle with recipient-device deletion, then determine how undeliverable messages should be removed. Done means stale messages no longer accumulate while successfully deliverable messages remain available until acknowledged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.