Skip to content

backfill: add a backfill_read_messages = false option#12

Merged
pawelb0 merged 1 commit into
pawelb0:mainfrom
vmiklos:only-backfill-unread-messages
Jul 1, 2026
Merged

backfill: add a backfill_read_messages = false option#12
pawelb0 merged 1 commit into
pawelb0:mainfrom
vmiklos:only-backfill-unread-messages

Conversation

@vmiklos

@vmiklos vmiklos commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Connect to an existing Matrix account from IRC, lots of ancient messages from rooms and DMs are backfilled, leading to a lot of noise.

This is useful if your IRC clinet stores no logs, but e.g. weechat shows the last few messages in a DM based on local logs, so the backfill of read messages in DM rooms is just noise.

Fix the problem by adding a new config option, backfill_read_messages: if that's false, then query read receipts and also the last own message and stop the backfill for messages older than those. Tracking own messages is helpful since even if a message has no read receipt, if there is an own reply to that, then we know that message is practically seen.

Also fix a problem in src/irc/conn.rs: it can happen that the IRC client connects first and the DM is only discovered a little bit later, now we backfill in that case correctly, too. The case I had was like this:

  • 19:41:49.055: rooms discovered during startup population
  • 19:41:49.078: backfill for the room happens That 23ms gap means my IRC client was already connected when matrix finished populating the bridge and then a non-DM event was backfilled correctly but a DM one was not.

Fixes #10.

Connect to an existing Matrix account from IRC, lots of ancient messages
from rooms and DMs are backfilled, leading to a lot of noise.

This is useful if your IRC clinet stores no logs, but e.g. weechat shows
the last few messages in a DM based on local logs, so the backfill of
read messages in DM rooms is just noise.

Fix the problem by adding a new config option, `backfill_read_messages`:
if that's false, then query read receipts and also the last own message
and stop the backfill for messages older than those. Tracking own
messages is helpful since even if a message has no read receipt, if
there is an own reply to that, then we know that message is practically
seen.

Also fix a problem in src/irc/conn.rs: it can happen that the IRC client
connects first and the DM is only discovered a little bit later, now we
backfill in that case correctly, too. The case I had was like this:
  - 19:41:49.055: rooms discovered during startup population
  - 19:41:49.078: backfill for the room happens
That 23ms gap means my IRC client was already connected when matrix
finished populating the bridge and then a non-DM event was backfilled
correctly but a DM one was not.

Fixes <pawelb0#10>.
@pawelb0

pawelb0 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

nice! thanks

@pawelb0 pawelb0 merged commit 8dfc84c into pawelb0:main Jul 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only backfill unread messages?

2 participants