element-hq / element-hq/synapse

Unable to mark an ignored event as read

Open
#20,049 1 comment 0 reactions 0 assignees View on GitHub
A-ignored-users T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

### Description

Messages from ignored users cannot be marked as read (`M_FORBIDDEN (HTTP 403): You don't have permission to access that event.`), which means a room may be unable to be marked as read if the end of the timeline is an event from an ignored user.

### Steps to reproduce

1. Join a room with another user
2. Other user sends a message. This is received through sync.
3. At the same time (or immediately after sync), mark the user as ignored, before the client marks the event as read (can be caused by the timeline being out of focus)
4. As the user is now ignored, the read marker update is rejected with "you don't have permission to access that event"
5. Since the read marker could not be moved, the unread count is permanently stuck until another, unignored message is sent

Specifically what happened in this instance was a user sent a message, and I clicked the button to ignore them. This presented a thread-blocking browser prompt, meaning my client could not receive more data until I interacted with the prompt (but was still syncing in the background, meaning it received further messages while this prompt was open). After blocking the user, the client then caught up with the background sync, which meant a message from the (now ignored) user was at the tail of the timeline, and at that point it attempted to move the read marker forward - this is when it was met with a 403 Forbidden.

### Homeserver

starstruck.systems

### Synapse Version

1.157.2

### Installation Method

pip (from PyPI)

### Database

healthy monolithic postgres

### Workers

Multiple workers

### Platform

client: Gomuks (`v26.07+dev.6d5b5879`)
Nothing else really relevant?

### Configuration

Full configuration is available at https://starstruck.systems/~star/synapse.yaml. Nothing relevant.

### Relevant log output

```shell
2026-08-05T01:36:26+01:00 DBG Request completed command=mark_read component=hicli duration=58.331526 method=POST req_body={"m.fully_read":"$QGbtB8r9XM37jNGw5vI-KPqDnQFJj6xOlStBKW--PZM","m.read":"$QGbtB8r9XM37jNGw5vI-KPqDnQFJj6xOlStBKW--PZM"} req_id=16515 request_id=414 response_length=83 response_mime=application/json status_code=403 url=https://starstruck.systems/_matrix/client/v3/rooms/%21I6lnzlw9F2bgvd9LXZbsdg8c2yzy6J7V47pTatxh3pI/read_markers
```

### Anything else that would be useful to know?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at Synapse's client read_markers endpoint and trace how ignored events are checked when processing the reported request. Reproduce the sequence with an ignored user's timeline event, then verify that advancing the read marker succeeds and the room's unread count is no longer stuck.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, authorization, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.