Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synapse doesn't backfill missing events when rejoining a room later #15717

Open
matrixbot opened this issue Dec 21, 2023 · 1 comment
Open

Synapse doesn't backfill missing events when rejoining a room later #15717

matrixbot opened this issue Dec 21, 2023 · 1 comment

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 21, 2023

This issue has been migrated from #15717.


Description

If I'm the only user from my home server in a room (with more users from other severs),
stays there for a while and get's a lot of events,
then leave the room,
then rejoins the room a few days later,
I'm missing the events in the room between the point where I left the room up to the point I rejoined the room.

Synapse does not backfill those events.

Steps to reproduce

  • As the only user from your home server, join a room with other servers
  • Stay in the room for a while to get events in the room ( like messages, joins etc)
  • Leave the room for a while (so long as to there being new events in the room)
  • Rejoin the room
  • See that the missing events doesn't get backfilled

You will see something like this:

  • you joining the room
  • messages
  • messages
  • messages
  • you leaving the room

missing events you will not see

I have reported this before years ago but I shut down that server before Matrix team started to investigate, and when they looked at the bug they closed it because I wasn't active any more. So this is an old bug and not something newly introduced.

Homeserver

sinnesro.se

Synapse Version

{"server_version":"1.84.1","python_version":"3.9.2"}

Installation Method

Debian packages from packages.matrix.org

Database

Single PostgreSQL, never used SQLite, never restored from backup

Workers

Single process

Platform

Debian 11 latest updated
Running in an LXD

Intel Core i5 12th gen, 16 GB RAM, 256 GB SSD

Configuration

No response

Relevant log output

I have included my home server logs earlier in the bug report because I don't know what is relevant to show here.

Anything else that would be useful to know?

No response

@matrixbot matrixbot changed the title Dummy issue Synapse doesn't backfill missing events when rejoining a room later Dec 22, 2023
@matrixbot matrixbot reopened this Dec 22, 2023
@kegsay
Copy link
Contributor

kegsay commented Mar 5, 2024

This is 100% reproducible so relabelled as O-Frequent.
This results in lost messages so relabelled as S-Major.

I hit this in a complement crypto test TestBobCanSeeButNotDecryptHistoryInPublicRoom when running it between 2 JS clients over federation. I realised that the sync v2 timeline response simply did not include the message sent when Bob had left. I wrote a Complement test to verify this bug: matrix-org/complement#716

It's worth noting EX does not have this bug due to how it manages timelines (in this scenario sliding sync just returns the join event and a prev_batch token, which makes clients hit /messages and everything is fine). This does mean that we do not honour the timeline_limit in this case, but it means that we return a correct timeline.

The effect of this bug is quite bad because:

  • clients won't see messages they are authorised to see,
  • clients have no mechanism to fetch those messages as the prev_batch token is before the affected messages,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants